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

David Vossel reviewboard at asterisk.org
Mon Apr 4 16:44:19 CDT 2011


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



/trunk/funcs/func_jitterbuffer.c
<https://reviewboard.asterisk.org/r/1157/#comment6795>

    One complication I am dealing with is how to handle the fact that a user could place a jitter buffer on both the read and the write side of the channel.  I think I should add a check at the beginning of this function to detect if a write jitter buffer is present on the channel, and if so exit.


- David


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/20110404/90a85010/attachment.htm>


More information about the asterisk-dev mailing list