PJSIP issues with Providers

Howdy all.

I manage around 30 FreePBX instances. We recently started using PJSIP to connect to our VoIP providers because of its ease of use.

CHANSIP trunks are rock solid all the time but with PJSIP, if there is an internet or provider outage the trunk sometimes won’t fully reconnect without resetting it. In one instance, a pjsip trunk will drop over night and never re-connect. Outbound calls still function but inbound calls will not.

I have changed the timeout settings as well as max retries. I have also disabled iptables and fail2ban in one instance to no avail.

Our solution is to just connect to providers with CHANSIP for now, but wanted to see if anyone else has run into these types of issues with pjsip.

If your provider supports it (and you have a static public IP address), have them send you calls via SIP URI, rather than registering to them. IMO this is more robust than registration.

Otherwise, note that setting Max Retries to 0 does not mean infinite. If you have the three retry intervals all set to 60 (one minute), then setting Max Retries to 1440 would retry for a day before giving up.

If neither of the above help, use ‘pjsip set logger host 11.22.33.44’ (substitute provider’s IP address) to view registration attempts (in the Asterisk logfile) and any responses.

Just sharing my experiences with pjsip - I am a newbie so I may have not done the configs correct but …

I had one chansip and three pjsip connections. I must say the pjsip was a lot easier to configure and would pick up all the hosts and add the relevant ‘match’ options automatically which was great. I had all pjsip connections calling in OK but two of them could not call out - outisbusy message kept popping up in the logs. After spending many hours looking for a solution and tweaking various option without success I sniffed the line with Wireshark and was surprised to see that the two failing pjsip connections was not doing NAT as was expected and sending the local address of the host in the from address in the sip invite messages. The one that was working would do the same and then would send another sip invite with the NATed address in the sip invite packet and hence was successful. I checked the Asterisk pjsip settings and made sure that I added my external IP address instead of leaving it blank which then should have picked up the NAT address from General settings but even that did not work.

Deleted the pjsip connection and re-created them as chansip then all my woes went away.

I did check almost all settings but as I said earlier, since I am new to Freepbx, it is possible that I may have missed something.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.