All. This is more of a description of what I have learned converting from chan_sip (deprecated) to chan_pjsip. I had tried several times before and wasn’t successful but my most recent attempt has worked out very well! All is working and I’m very happy. I am running several Virtual PBX systems at Cyberlynk, all multiprocessor systems, lots of ram with ssd disk. My SIP provider is Telnyx. I had been having problems for years that were getting worse with every upgrade and patch install. The most recent patches (last 5-6 months) the issues were getting so noticeable that customers were complaining about audio quality issues on calls. It was time for some significant diagnostics. I added more ram, more CPU, started looking at different SIP servers, and new hosting, but nothing seems to help.
Basic config
All my PBX’s are at a hosting center, using FreePBX firewall with intrusion detection setup. I have all my networks whitelisted and set intrusion detection to be really strict, if you get banned on my pbx its just about forever. Once in a blue moon one of my customer IP’s get banned (usually after patches and a restart for some reason). After loading my monthly updates I look for any known IP’s to be banned and I just unban it and everything is fine. No issues otherwise. My setup is hosting <> firewall1 <> internet <> firewall2 <> extension. Firewall1 is part of the hosting environment (in FreePBX I have control over, but whatever hosting is using I don’t). Firewall2 is typically under my customers control and except for a few customers with SonicWALL routers I haven’t had to ask any customer to make a change in their firewall configs.
Hosting
Currently I am on Cyberlynk. Primarily because it included SYSADM and EPM for free and seemed to somehow be linked to Sangoma even if indirectly. When having problems I asked for suggestions here and got many different answers. Was all set to try another virtual and sip provider when the issue was resolved so I didn’t make the switch. It was going to be a lot of work to move 1000 numbers over so I wasn’t looking forward to that. Glad I don’t have to. Overall now I am happy there. Pricing is pretty good, support has been pretty good (although any time there is an issue its never “their equipment” but magically after I complain it goes away). Very easy to build a server and I have full access to console and VM manager.
Extensions
I have several different versions of FreePBX, most are fairly up to date All my PBX’s were using chan_sip for trunks and extensions on standard ports. When I started moveing over to pjsip I couldn’t get anything to work but it turns out there were lots of compatibility issues with the standard ports and several ISP’s. Some issueswere related to what I can only guess was SIG ALG options and others just seem to be old broadband routers with bad ARP cache issues. I would have phones that worked fine for months and then all of a sudden, a phone or two would stop working. I just couldn’t get them to work again, tried everything, factory reset the phone, delete re-add the extensions, I tried everything, ultimately I would just program a new phone send it out and then it would work. Bring the other non working phone back to the office and reprogram it and it would work fine. The only thing I can think happened is some how the broadband router/modem was caching something related to the mac on the phone and it just couldn’t get through to the PBX (i.e. I would no longer see any traffic from it to the pbx). New phone worked fine, old phone worked fine anywhere else. All these problems went away when I switch to pjsip and none standard ports. To add the extensions application->extensions click on add extension-> add pjsip, on “general” enter an extension number, name, CID must be a valid caller ID i.e. “name” <10digits> , on Other click brand, enter a mac, template, model but you need to create the template before hand (under settings->EPM->brand). Be sure to select the model in both the template and in “other”.
If your phone is already setup as chan_sip, I have used the "convert to pj_sip, then in EPM click “save/update phone”, the phone reboots and is now pj_sip!
Telnyx
Had an issue at first when I was trying to use none standard ports with Telnyx. They only support non standard ports in one direction. When sending to Telnyx you can ONLY use 5060 and 5160/5161. But when you add the connection at Telnyx you can enter any port number you want for the connection from Telnyx to your PBX. In freepbx->settings->asterisk sip settings under the chan_pjsip tab change the “listen to port on” field to the port you want to use (anything other than 5060, 5160, 5161) and what ever you use you will add a connection in Telnyx->sip connections->add and when you put in your IP use the same port number as freepbx by following the IP with :xxxx where xxx is your port number. I have found that on Telnyx, IP connections are much more reliable than “credential based” connections. All connections should be E.164 and in Freepbx all inbound routes are 11 digits (1NXXNXXXXXX). Telnyx has a quick document to setup FreePBX extension and a connection here-> How to configure a FreePBX V15 IP Trunk - PJSIP | Telnyx Support
Phones
Almost all phones are much easier to setup (except Sangoma zero touch) by using a web browser. I have been using grandstream gxp2170’s lately and they work every well. Go to the phone via a browser and click on “maintenance, provisioning”. You only need to set the config server IP and even if you choose tftp you must add :69 after the IP (don’t know why it doesn’t do that when you click the tftp button?). Enter the IP and :69 click save/apply and at the top click provision. The process takes about 20-30 seconds and the phone sets itself up, nothing else to do!
Hope this saves someone some time. I have learned all this in my effort to switch from chan_sip to pjsip. All my audio issues went away after switching to pjsip. somehow, grandstream devices were having an issue with the chan_sip jitter mechanism? I was able to minimize the issue by setting jitter to small and buffer to minimum but completely eliminated it when switching to pjsip.
DJ