[asterisk-dev] [Code Review] Fix local channel chains optimizing themselves out of a call.

Mark Michelson reviewboard at asterisk.org
Thu May 3 11:18:35 CDT 2012


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

Ship it!


I'm not seeing anything wrong with the code here. The only suggestions I have are style improvements, which you are free to ignore.


/branches/1.8/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1894/#comment11247>

    You may as well invert this and exit early so you can reduce indentation a bit here.



/branches/1.8/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1894/#comment11248>

    You could also invert this if statement in order to decrease further indentation.


- Mark


On May 2, 2012, 12:22 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1894/
> -----------------------------------------------------------
> 
> (Updated May 2, 2012, 12:22 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> The masquerade torture test (ASTERISK-19807) is a long chain of local channels to be optimized out of a call when answered.
> This patch fixes local channel so it can successfully optimize itself out when there are chains of channels.
> 
> The principle problem was check_bridge() failed to check the ast_channel_masquerade() return value to see if the masquerade was actually setup.  In long chains of local channels, the masquerade occasionally fails to get setup because there is another masquerade already setup on an adjacent local channel in the chain.
> 
> * Checks the return value of ast_channel_masquerade().
> 
> * Made sure that the outgoing local channel (the ;2 channel) also does not have any frames in its queue before the masquerade.
> 
> * The outgoing channel will flush one voice or video frame per optimization attempt.
> 
> * Do the masquerade immediately to ensure that the outgoing channel queue does not get any new frames added and thus unconditionally flushed.
> 
> * Blocks indication -1 (Stop tones event) when the local channel is going to optimize itself out.  When the call is answered, a chain of local channels pass down a -1 indication for each bridge.  This blizzard of -1 events really slows down the optimization process.
> 
> 
> This addresses bug ASTERISK-16711.
>     https://issues.asterisk.org/jira/browse/ASTERISK-16711
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/channels/chan_local.c 364846 
> 
> Diff: https://reviewboard.asterisk.org/r/1894/diff
> 
> 
> Testing
> -------
> 
> Chains of 100 local channels now are able to optimize themselves out.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120503/5b625c06/attachment.htm>


More information about the asterisk-dev mailing list