]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_websocket.c: Change payload references to command instead.
authorGeorge Joseph <gjoseph@sangoma.com>
Wed, 8 Oct 2025 13:42:41 +0000 (07:42 -0600)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 30 Oct 2025 16:09:11 +0000 (16:09 +0000)
Some of the tests in process_text_message() were still comparing to the
websocket message payload instead of the "command" string.

Resolves: #1525

channels/chan_websocket.c

index eb680d570c96944e3a16d68075fb4053ee810767..7357005cc1cce489bf302e3d5c33710bef6b4c63 100644 (file)
@@ -577,7 +577,7 @@ static int process_text_message(struct websocket_pvt *instance,
                instance->leftover_len = 0;
                AST_LIST_UNLOCK(&instance->frame_queue);
 
-       } else if (ast_strings_equal(payload, REPORT_QUEUE_DRAINED)) {
+       } else if (ast_strings_equal(command, REPORT_QUEUE_DRAINED)) {
                if (instance->passthrough) {
                        ast_debug(4, "%s: WebSocket in passthrough mode. Ignoring %s command.\n",
                                ast_channel_name(instance->channel), command);
@@ -609,7 +609,7 @@ static int process_text_message(struct websocket_pvt *instance,
                        ast_free(status);
                }
 
-       } else if (ast_strings_equal(payload, PAUSE_MEDIA)) {
+       } else if (ast_strings_equal(command, PAUSE_MEDIA)) {
                if (instance->passthrough) {
                        ast_debug(4, "%s: WebSocket in passthrough mode. Ignoring %s command.\n",
                                ast_channel_name(instance->channel), command);
@@ -619,7 +619,7 @@ static int process_text_message(struct websocket_pvt *instance,
                instance->queue_paused = 1;
                AST_LIST_UNLOCK(&instance->frame_queue);
 
-       } else if (ast_strings_equal(payload, CONTINUE_MEDIA)) {
+       } else if (ast_strings_equal(command, CONTINUE_MEDIA)) {
                if (instance->passthrough) {
                        ast_debug(4, "%s: WebSocket in passthrough mode. Ignoring %s command.\n",
                                ast_channel_name(instance->channel), command);