mirror of
https://github.com/asterisk/asterisk.git
synced 2026-02-17 05:20:41 +00:00
We now add the websocket's file descriptor to the channel's fd array and let it poll for data availability instead if having a dedicated thread that does the polling. This eliminates the thread and allows removal of most explicit locking since the core channel code will lock the channel to prevent simultaneous calls to webchan_read, webchan_hangup, etc. While we were here, the hangup code was refactored to use ast_hangup_with_cause instead of directly queueing an AST_CONTROL_HANGUP frame. This allows us to set hangup causes and generate snapshots. For a bit of extra debugging, a table of websocket close codes was added to http_websocket.h with an accompanying "to string" function added to res_http_websocket.c Resolves: #1683