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

David Vossel reviewboard at asterisk.org
Thu Mar 31 17:29:43 CDT 2011


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

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/20110331/635045fd/attachment-0001.htm>


More information about the asterisk-dev mailing list