Asterisk JITTERBUFFER function details

Asterisk v15 documentation states that JITTERBUFFER function is used to “add a Jitterbuffer to the Read side of the channel”. Take this dialplan example:

[from-pstn]
exten => 1234,1,Set(JITTERBUFFER(adaptive)=default)
exten => 1234,n,Dial(PJSIP/1234)

It is safe to assume that jitter buffer is applied to the calling channel. What about the answering channel (PJSIP/1234 in this case)? Is jitter buffer applied to it as well? If not, how to apply it?

Yes that jitter buffer is only being applied to the inbound side. If you want to apply a jitter buffer to the outbound side you’ll need to use a pre-dial subroutine:

exten => outbound_jitterbuf,1,NoOp()
same => n,Set(JITTERBUFFER(adaptive)=default)
same => n,Return()

exten => alice,1,Noop()
same => n,Dial(${TECH}/${EXTEN},20,b(default^outbound_jitterbuf^1))

More information and examples about pre-dial handlers can be found at the following:

Application dial
Pre-Dial Handlers

3 Likes