]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_websocket.c: Tolerate other frame types
authorJoe Garlick <jcbjoe@users.noreply.github.com>
Wed, 12 Nov 2025 11:47:38 +0000 (11:47 +0000)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 19 Nov 2025 17:23:25 +0000 (17:23 +0000)
Currently, if chan_websocket receives an un supported frame like comfort noise it will exit the websocket. The proposed change is to tolerate the other frames by not sending them down the websocket but instead just ignoring them.

Resolves: #1587

channels/chan_websocket.c

index 8235ccebc34b11744df84c7c0a8048d76c5d56ff..0d6e6c9fa31f44a659b94b4cf9b75e316c0bc624 100644 (file)
@@ -1168,10 +1168,14 @@ static int webchan_write(struct ast_channel *ast, struct ast_frame *f)
                return -1;
        }
 
+       if (f->frametype == AST_FRAME_CNG) {
+               return 0;
+       }
+
        if (f->frametype != AST_FRAME_VOICE) {
                ast_log(LOG_WARNING, "%s: This WebSocket channel only supports AST_FRAME_VOICE frames\n",
                        ast_channel_name(ast));
-               return -1;
+               return 0;
        }
 
        if (ast_format_cmp(f->subclass.format, instance->native_format) == AST_FORMAT_CMP_NOT_EQUAL) {