chan_websocket: Reset frame_queue_length to 0 after FLUSH_MEDIA

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
This commit is contained in:
kodokaii
2025-07-03 19:40:10 +02:00
committed by github-actions[bot]
parent 0086f4a0b8
commit f9219284cb

View 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);