Hello,
I run FreePBX on a dedicated server within LAN and it is behind NAT. I have a pretty good symmetric gigabit internet connection. My system has a single PJSIP-trunk connection to my VoIP provider and a bunch of local extensions.
Everything works fine for regular inbound and outbound phone calls through the trunk, as well as local calls between extensions work great.
However, when I enable IVR (or voicemail) for the inboud calls, some (~1 out of 5) of the calls from the trunk either have hiccups in the beginning (in the first 1-2 seconds) after the IVR picks up the line,
or, sometimes, the caller hears only several fragmentary sounds of the IVR greeting and then the audio just stops.
I can see in sngrep that in the latter case the incoming(?) RTP stream from the VoIP provider fully stops. When it happens, and if the caller stays on the line just listening silence, the inboud call eventually times out after few minutes.
To cope with hiccups I’ve added a 2 seconds silence before the IVR greeting and it partially solved the problem. But, unfirtunately, some calls coming to IVR still loose the incoming RTP stream…
I noticed that this problem mostly happens to inboud calls from cellular networks, as those packets often have higher jitter.
I’m guessing that the problem is that for regular incoming calls my VoIP phones (Cisco SPA504G) have their own jitter buffers, that’s why everything works just fine. However, for IVR the jitter buffer should be manually enabled in FreePBX between the trunk and IVR.
I have found these articles:
http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/Voicemail_id292544.html
But it is not really clear how to enable the jitter buffer in FreePBX for the inbound route between the SIP trunk and IVR.
I guess, I need to modify /etc/asterisk/extensions_custom.conf. My SIP trunk uses from-pstn context. I tried to make my own context from-pstn-buffered, but I’m not sure it works for IVR:
[from-pstn-buffered]
exten => s,1,NoOp(From PSTN buffered)
same => n,Set(JITTERBUFFER(fixed)=210,1500)
same => n,Goto(from-pstn,${EXTEN},1)
Is it getting optimized away or should I use one of those local channels? It’s not really clear to me.
Any help would be much appreciated, thank you!