[asterisk-dev] [Code Review] 3248: Fix for WebRTC over WSS not working

Moises Silva reviewboard at asterisk.org
Sun Mar 2 19:19:42 CST 2014



> On Feb. 27, 2014, 3:05 p.m., opticron wrote:
> > /branches/11/res/res_http_websocket.c, line 318
> > <https://reviewboard.asterisk.org/r/3248/diff/1/?file=54350#file54350line318>
> >
> >     Turn this into a proper function that returns zero/non-zero for success/failure.

That's fair, I got a little too excited adding stuff to that macro :)


> On Feb. 27, 2014, 3:05 p.m., opticron wrote:
> > /branches/11/res/res_http_websocket.c, lines 717-718
> > <https://reviewboard.asterisk.org/r/3248/diff/1/?file=54350#file54350line717>
> >
> >     Drop this debug message.
> 
> Matt Jordan wrote:
>     I wouldn't mind if we had a debug message for some of these things, but it should use the standard ast_debug message call:
>     
>     ast_debug(5, "Entering WebSocket echo loop\n");

Yeah I like the ast_debug() idea better. I added those messages precisely because while troubleshooting this issue I felt it lacked proper debugging messages to determine where the problem could be. I've replaced the other instances of the same situation using ast_debug() instead of ast_log(LOG_DEBUG, )


- Moises


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3248/#review10969
-----------------------------------------------------------


On March 3, 2014, 1:19 a.m., Moises Silva wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3248/
> -----------------------------------------------------------
> 
> (Updated March 3, 2014, 1:19 a.m.)
> 
> 
> Review request for Asterisk Developers and rnewton.
> 
> 
> Bugs: ASTERISK-21930 and ASTERISK-23099
>     https://issues.asterisk.org/jira/browse/ASTERISK-21930
>     https://issues.asterisk.org/jira/browse/ASTERISK-23099
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Several fixes for the WebSockets implementation in res/res_http_websocket.c
> 
> * Flush the websocket session FILE* as fwrite() may not actually guarantee sending
>   the data to the network. If we do not flush, it seems that buffering on the SSL
>   socket for outbound messages causes issues
> 
> * Refactored ast_websocket_read to take into account that SSL file descriptors
>   may be ready to read via fread() but poll() will not actually say so because
>   the data was already read from the network buffers and is now in the libc buffers
> 
> This should fix an issue that I have experienced and other users may have reported [1][2][3], where
> secure websockets wouldn't work, messages seem to not make it into Asterisk
> 
> [1] http://lists.digium.com/pipermail/asterisk-users/2013-August/280175.html
> [2] https://issues.asterisk.org/jira/browse/ASTERISK-21930
> [3] https://issues.asterisk.org/jira/browse/ASTERISK-23099
> 
> 
> Diffs
> -----
> 
>   /branches/11/res/res_http_websocket.c 409360 
> 
> Diff: https://reviewboard.asterisk.org/r/3248/diff/
> 
> 
> Testing
> -------
> 
> See ASTERISK-21930 for details on other users testing these changes. I did both WS and WSS calls, confirmed audio works with chrome. This patch is for Asterisk 11 as the issue is reported on Asterisk 11, but I tested a few months ago and same issue existed on 12 and trunk. I created my own team branches for those too (/team/moy/webrtc-11, /team/moy/webrtc-12, /team/moy/webrtc-trunk)
> 
> Confirmed working by Sean Bright on Jan 20, 2014 on Asterisk 11 (see ASTERISK-21930 comment)
> 
> 
> Thanks,
> 
> Moises Silva
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140303/49143f27/attachment.html>


More information about the asterisk-dev mailing list