Jitterbuffer
From FreeSWITCH Wiki
The jitter buffer is implemented in the Sort Transportable Framed Utterances (STFU) library. The jitter buffer is not enabled by default.
Contents |
Activation instructions
The jitter buffer can be activated via channel variable, dialplan app, or sofia param.
The jitter buffer has three params that control its behavior: length, max length, and max drift. Length is the initial size of the jitter buffer in milliseconds. Max length is the upper bound for how big the jitter buffer can grow. Max drift controls how much delay the jitter buffer will tolerate before dropping frames to make up ground.
Dialplan app
Enable 60 ms jitter buffer
<action application="jitterbuffer" data="60"/>
Enable 60 ms jitter buffer with 200ms max length and 20 ms max drift.
<action application="jitterbuffer" data="60:200:20"/>
Sofia profile param
This param is the initial size of the jitter buffer in milliseconds. The max length and max drift values can't be set with this param.
<param name="auto-jitterbuffer-msec" value="60"/>
jitterbuffer_msec
Activates the jitter buffer. The jitter buffer has three params: length, max length, and max drift.
Usage:
<action application="set" data="jitterbuffer_msec=60:200:20"/>
<action application="answer"/>
Or to set it on the subsequent outbound call: export sets a variable on both the current channel and on any channels it creates, the 'nolocal:' disables setting it on the current channel and only sets it on the subsequent outbound channels.
<action application="export" data="nolocal:jitterbuffer_msec=60"/>
<action application="bridge" data="sofia/default/888@conference.freeswitch.org"/>
You can also activate the Jitter Buffer in the bridge as follows:
<action application="bridge" data="{jitterbuffer_msec=60}sofia/gateway/$1@gateway.com"/>
This will add a jitter buffer to packets flowing from a remote gateway towards a local freeswitch user. The network would look like this:
(local sip user) -----> FreeSWITCH -----> (remote gateway)
Where the link between the freeswitch and the remote gateway has a bad, jitter causing connection, and say the local sip user has no jitter buffering on their IP-phone. This will help the voice quality for the incoming audio.
Other usage
sip_jitter_buffer_plc
Enables/disables packet loss concealment (PLC) when using the jitter buffer. PLC is enabled by default when the jitter buffer is enabled. Set this variable before enabling the jitter buffer for it to have an effect.
Usage:
<action application="set" data="sip_jitter_buffer_plc=true"/>
or,
<action application="set" data="sip_jitter_buffer_plc=false"/>
sip_jitter_buffer_during_bridge
Enables/disables the jitter buffer during bridge.
Usage:
<action application="set" data="sip_jitter_buffer_during_bridge=true"/>
or,
<action application="set" data="sip_jitter_buffer_during_bridge=false"/>
Pause
The jitter buffer can be paused mid-call
<action application="jitterbuffer" data="pause"/>
Resume
The jitter buffer can be resumed mid-call
<action application="jitterbuffer" data="resume"/>
Debug
Jitter buffer debugging can be enabled/disabled.
<action application="jitterbuffer" data="debug:${uuid}"/>
<action application="jitterbuffer" data="debug:off"/>

