mirror of
https://github.com/asterisk/asterisk.git
synced 2026-02-13 03:32:21 +00:00
chan_websocket: Fixed Ping/Pong messages hanging up the websocket channel
When chan_websocket received a Ping or a Pong opcode it would cause the channel to hangup. This change allows Ping/Pong opcodes and allows them to silently pass
This commit is contained in:
@@ -1116,6 +1116,10 @@ static int read_from_ws_and_queue(struct websocket_pvt *instance)
|
||||
return process_text_message(instance, payload, payload_len);
|
||||
}
|
||||
|
||||
if (opcode == AST_WEBSOCKET_OPCODE_PING || opcode == AST_WEBSOCKET_OPCODE_PONG) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (opcode == AST_WEBSOCKET_OPCODE_CLOSE) {
|
||||
ast_debug(3, "%s: WebSocket closed by remote\n",
|
||||
ast_channel_name(instance->channel));
|
||||
|
||||
Reference in New Issue
Block a user