I am currently having issues with the IAX jitterbuffer introducing delay into a call.
I have two asterisk servers connected via IAX.
I have another SIP server connected to Asterisk B.
“SIP Phone” <— (SIP) —> “Asterisk A” <— (IAX) —> “Asterisk B” <— (SIP) —> “Other SIP server”
When I make a call from my SIP Phone to the Other SIP Server, the call traverses IAX, reaches Asterisk B where a PJSIP channel is created to the Other SIP Server. A SIP Invite is sent from Asterisk B to Other SIP Server and a Trying is sent back. However the Other SIP server seems to send early audio (I can see in a wiretrace that there is RTP traffic from the Other SIP Server) before the Other SIP Server sends a 200 OK. All of this is being received by Asterisk B and forwarded back to the IAX channel on Asterisk A. However when the Other SIP Server sends the 200 OK (after ~ 4 seconds) and it is then received by Asterisk A, I can see using “iax2 show channels” that the IAX jitterbuffer believes there is then 4000ms of jitter. The jitterbuffer then maxes out. After this initial spike, the jitterbuffer determines that there is no jitter on the channel however it takes a few minutes for the jitter buffer to empty (it is set at max 4000ms).
I have looked at the time on each device and they are all synced using an ntp server.
In IAX “trunktimestamps”=“yes”.
It seems as though when IAX recieves this “200 OK” which it considers a control message, it resets the time input for the point of reference for the IAX channel and throws the jitter buffer off.
I’m wondering if this has been tested before, IAX being able to handle the situation where early audio is sent before a call is properly established?