[asterisk-dev] [Code Review] JITTERBUFFER dialplan function - places a jitterbuffer on the read side of a channel

Russell Bryant reviewboard at asterisk.org
Fri Apr 15 15:17:58 CDT 2011


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

Ship it!


This needs some good documentation to go along with it that we can throw up on a wiki page.

- Russell


On 2011-03-31 17:29:42, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1157/
> -----------------------------------------------------------
> 
> (Updated 2011-03-31 17:29:42)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch allows a jitterbuffer to be placed on the read side of a channel using a dialplan function.
> 
> I accomplished this by using framehooks (awesomehooks) to capture audio frames in the read direction of a channel.  As frames enter into the framehook callback two things may occur.
> 
> 1. If the frame is audio, it is placed into the jitterbuffer and then converted to a null frame.
> 2. If the frame either comes in as a null frame, or is converted from audio to a null frame, the jitter buffer is checked to see if a frame is ready to be released.  If this is the case, the null frame is replaced by the next available dejittered frame from the jitterbuffer queue.
> 
> Frames are guaranteed to be released at a consistent interval through the use of a timer.  The channel listens to this timer's fd causing read to get called each time the timer fires.  Read will get called more often that usual with a jitterbuffer on the channel, but frames will not be released until the right delivery time is met.
> 
> 
> Diffs
> -----
> 
>   /trunk/funcs/func_jitterbuffer.c PRE-CREATION 
>   /trunk/include/asterisk/abstract_jb.h 312069 
>   /trunk/include/asterisk/channel.h 312069 
>   /trunk/main/abstract_jb.c 312069 
>   /trunk/main/channel.c 312069 
> 
> Diff: https://reviewboard.asterisk.org/r/1157/diff
> 
> 
> Testing
> -------
> 
> I tested this by creating simulated network delay with netem.  Delay was set to vary between 200ms-100ms and packets were set to vary in the order they were sent.
> 
> A call coming in on the network with delay enters a meetme conference and plays back a file. Another phone is used to connect to that meetme conference without the simulated delay to hear the effect of the network on audio quality.  Without the jitterbuffer enabled on the playback channel, the audio being played into the conference sounds terrible.  With either an adaptive or fixed jitterbuffer set at at least 200ms in size the audio sounds perfect.
> 
> 
> Thanks,
> 
> David
> 
>

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


More information about the asterisk-dev mailing list