]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_websocket: Reset frame_queue_length to 0 after FLUSH_MEDIA
authorkodokaii <kodokai.featheur@gmail.com>
Thu, 3 Jul 2025 17:40:10 +0000 (19:40 +0200)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 15 Jul 2025 13:46:10 +0000 (13:46 +0000)
In the WebSocket channel driver, the FLUSH_MEDIA command clears all frames from
the queue but does not reset the frame_queue_length counter.

As a result, the driver incorrectly thinks the queue is full after flushing,
which prevents new multimedia frames from being sent, especially after multiple
flush commands.

This fix sets frame_queue_length to 0 after flushing, ensuring the queue state
is consistent with its actual content.

Fixes: #1304
channels/chan_websocket.c

index 58728af32a5eaa73b2112b25923cd44c5af9aaa7..1600871842d093fe1e0cc916d637d9f2ad5230a6 100644 (file)
@@ -476,6 +476,7 @@ static int process_text_message(struct websocket_pvt *instance,
                while ((frame = AST_LIST_REMOVE_HEAD(&instance->frame_queue, frame_list))) {
                        ast_frfree(frame);
                }
+               instance->frame_queue_length = 0;
                instance->bulk_media_in_progress = 0;
                instance->leftover_len = 0;
                AST_LIST_UNLOCK(&instance->frame_queue);