[asterisk-dev] [Code Review] Improve behavior of ast_answer() to not lose incoming frames

Russell Bryant russell at digium.com
Mon Mar 16 16:09:08 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/196/#review547
-----------------------------------------------------------



/trunk/main/channel.c
<http://reviewboard.digium.com/r/196/#comment1284>

    This should actually be INSERT_HEAD().  Otherwise, the frames do not end up in the proper order when the get put back on the channel.



/trunk/main/channel.c
<http://reviewboard.digium.com/r/196/#comment1283>

    I would rather use a switch statement here (with no default case).  That way, as new frame types are added, we will get a compiler warning telling us that this piece of code should be addressed.



/trunk/main/features.c
<http://reviewboard.digium.com/r/196/#comment1285>

    Hm, I thought we discussed just asking ast_answer() to not do the waiting at all in the case of a bridge?


- Russell


On 2009-03-16 15:59:55, Kevin Fleming wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/196/
> -----------------------------------------------------------
> 
> (Updated 2009-03-16 15:59:55)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> ast_answer(), when supplied a delay before returning to the caller, use ast_safe_sleep() to implement the delay. Unfortunately during this time any incoming frames are discarded, which is problematic for T.38 re-INVITES and other sorts of channel operations.
> 
> When a delay is not passed to ast_answer(), it still delays for up to 500 milliseconds, waiting for media to arrive. Again, though, it discards any control frames, or non-voice media frames.
> 
> This patch rectifies this situation, by storing all incoming frames during the delay period on a list, and then requeuing them onto the channel before returning to the caller.
> 
> 
> Diffs
> -----
> 
>   /trunk/main/channel.c 182359 
>   /trunk/main/features.c 182359 
> 
> Diff: http://reviewboard.digium.com/r/196/diff
> 
> 
> Testing
> -------
> 
> Compile testing only.
> 
> 
> Thanks,
> 
> Kevin
> 
>




More information about the asterisk-dev mailing list