Going PJSIP

I read “please note that chan_sip will be going away in future versions of Asterisk” and felt a shudder go down my spine.

I had to replace my PBX last year and decided to build a purely pjsip system, as it was the future and I needed to get my head around the new channel it seemed an obvious choice.

Now I don’t claim to an expert but I can generally get my head around most IP PBX software. My first installations many years ago were Axon PBX, then Snom One, and more recently 3CX. In addition I have installed Grandstream PBX’s and Epygi systems, all without that much drama. I first started using FreePBX on a Raspberry PI about two years ago and have been installing FreePBX for about the last year. I would guess I have done more than 200 systems over the years and about 25 FreePBX systems to date all using chan_sip. So I am no expert with Asterisk but I am not a complete idiot with VOIP either.

From first use I was very impressed with FreePBX, moving into a Linux based systems from windows was always going to have its challenges but the transition was nowhere near as painful as I expected. The systems were easy to install, quite intuitive to set up and are feature rich, robust and very reliable, what was not to like.

Then my endeavours with pjsip started. Despite my best efforts I quickly had to abandon the idea of a pjsip only system, I simply could not get a system up and running, so I went for a compromise with chan_sip as the main channel and two extensions with two trunks on pjsip to test, evaluate and learn what was needed to get the channel working.

So far my problems with pjsip have been:-

  1. Pjsip trunks won’t update the IP address on remote servers when their dns moves to a new IP or the main server changes its IP. The problem is when one of the connections gets anew IP address; let’s say Server (A) gets a new external IP Address.

On server (A) all pjsip end points (extensions and trunks) become unavailable, phones cannot register with the extension status becoming unknown and the trunks show as unavailable.
They will not come back until I restart the asterisk service (service asterisk restart) when all is well again.

At the same time server (B) will now show the trunk to server (A) as available again and allow outbound calls, however the “Match (Permit)” on the trunk does not update so no inbound calls are coming through.

Only a complete reload brings it all back to life.

  1. I adjusted the trunk so that “Match (Permit)” was set to 0.0.0.0/0.0.0.0.0 to allow any connections, realising this might present a security issue it was only a temporary solution to test it. However once changed no extensions could register on the pjsip channel. As soon as I removed the entry all the extensions came back on line.

  2. Another problem related to above appears be registering extensions that are mobile.

Two PBX’s connected with a pjsip for extension to extension dialling and working fine.

A soft phone (Linphone) installed on an iPhone and registering against PBX A and working fine. This can register anywhere in the world and works great except at the location of PBX B . When it tries to register from that location PBX A does not register it as an extension, it matches the external IP address to the trunk “Match: xxx.xxx.xx.xxx/32” section, tries to register it as a trunk not an extension and then the registration fails. This arrangement works fine with chan_sip.

  1. If the system becomes disconnected from the internet for even a few seconds then comes back online with the same IP on many occasions the pjsip channel is collapsing, all extension lose their registration and all trunks lose their connectivity.

Only a restart of the Asterisk brings it all back to life.

  1. I have a Orbtalk (UK) trunk that uses an outbound proxy in its settings. I can get pjsip to register OK and make out bound calls fine, however on inbound calls the inbound audio fails, the caller can hear me but I can’t hear them, I haven’t been able to resolve this yet.

  2. I have a Sipgate (UK) trunk, and again that will register fine and work on inbound calls, I get audio in both directions, but I am unable to make any out bound calls, the call just holds on the extension without ringing and after about 30 seconds I get a message saying the call was not answered. On the inbound calls the failure rate is about one in ten, I haven’t been able to resolve this yet.

  3. I have a voipcheap (UK) account I only use for dialling out on. This appeared to set up fine and work, however about one in fifteen calls made on it fail, on chan_sip the failure rate is probably about one in five hundred.

  4. Call pickup (*8) and (**) won’t work at all on pjsip extensions and chan_sip extensions cannot pick the calls up when the call is directed to a pjsip extension.

  5. If I run pjsip on a PBX with more than one IP address I have to run the service on all the IP addresses, if I restrict the service to one IP address I cannot register any extensions or make calls between the trunks.

  6. I am generally using Polycom phone and find the reboot feature in FreePBX very useful, however when the extension is changed over to pjsip the phone is not listed to be rebooted.

  7. While adding video codecs to pjsip extensions does allow video to work fine I haven’t found any way to add video support to a pjsip trunk yet.

In general my efforts to implement pjsip have been a complete disaster. What started off as pjsip only system has now become (apart from one test trunk) a chan_sip only system.

I think a lot of the problems stem from using a system behind a dynamic IP Address so I am using dns to locate the system, this is working absolutely fine for chan_sip, and seems fully supported, but I do remember reading somewhere that it is not in pjsip. Clearly, when many small businesses and certainly home users don’t have access to reasonably price fixed IP address this may be quite a problem.

It should be noted that all the problems I have encountered with pjsip are on a system that is running chan_sip without any issues at all, so I am using a tested network, router, PBX Hardware and phones (including firmware). So in theory, if it all works with chan_sip but fails with pjsip then it points me to the problem being pjsip.

In general I would have to say that even when I have got pjsip working its feels very flakey and unstable compared with chan_sip. Chan_sip is not broken, but pjsip feels very broken, the problem is as end users we might not always have the option to choose. I really fear for the day I download FreePBX and find there is no chan_sip support.

I am not sure what other software uses the pjsip technology but I get the feeling it is better suited to supporting phones and soft phones than to pbx’s and trunks, again maybe I have lost the plot, but at the moment I would rather see a future with chan_sip and not pjsip. If I saw an announcement saying pjsip in Asterisk had been abandoned then it would probably be the best IT news I had heard for a decade.

I don’t know if other users have had better experiences than me with pjsip but when I have posed questions on this forum about its reliable implementation answers have been few and far between. Maybe I have just lost the plot, or maybe I am just one of many who have lost the plot !!!

To date, chan_sip I have implemented with ease, pjsip still has me completely beat !!

3 Likes

This will probably not happen within the next 5 years.

Most of what you have had problems with should be brought up to Asterisk/Digium. Not FreePBX. Almost everything you are complaining about stems from your difficulties with PJSIP. Something FreePBX is unable to control (outside of configuration) and complaining/voicing your opinions here isn’t going to change the stability of pjsip.

Knowing the Asterisk developers personally I can say from my standpoint this is very unfortunate. They have worked very hard on making pjsip work and your defeatist attitude is just depressing. Have you reported any of these issues to the Asterisk issue tracker?

1 Like

Firstly please let me apologies if my posting sounded like a rant against FreePBX or Asterisk, it wasn’t or meant to be.

I had contributed to a few posts where people had asked about the issues involved in moving to pjsip, as they were planning to do so, I was simply sharing my experiences, and to a degree frustrations. My post was originally a reply to another post but appears to have been moved to its own post.

It’s good to know we have five years before all the issues need to be addressed.

I do have to confess a slightly defeatist attitude to date, because in reality I have been defeated, however this in no way implies I intend to remain defeated by pjsip in the long term.

I full appreciate the hard work put in by everyone at FreePBX and Asterisk, your joint efforts make a great product which I enjoy using and I don’t want to sound critical of the product, quite the contrary, I find it very impressive.

When it comes to reporting faults I have to accept my technical limitations. While quite competent at installing, configuring and solving problems with installations I am certainly not a software developer. I am not sure on particular issues whether they relate to the underlying technology of pjsip, the Asterisk implementation of pjsip or the configuration tools in FreePBX regarding pjsip and therefore I am generally reluctant to report bugs.

I did make posting on this forum regarding particular problems I had while trying to work with pjsip, the replies were quite scarce and didn’t really help me understand if the technology had issues or I had simply lost the plot. I noted others had not raised similar concerns, so did their installations go better than mine or is the uptake on the pjsip channel still very limited among users so that issues have not become highlighted, I wasn’t sure.

I have no doubt that over the next five years substantial improvements will occur. I am happy to report bugs to assist this process so long as I am certain I am reporting the problem to the right place. For instance, call pick up, is that a pjsip or FreePBX issue, I am really not certain.

It would be good to hear from more people about their experience of pjsip to better understand the issues relating to its implementation.

When trying to build a purely pjsip system I didn’t expect it to bug free, but I needed it to be reasonable dependable so that I could use and development its implementation, this is really what defeated me, I just couldn’t get it working to a feasible level of reliability to continue using it.

Good Morning,

I have installed also a number of FreePBX systems, and like Paul I am also no expert on the program side. The only problem I experienced with pjsip was that BLF did not work at all. When I switched back to chansip BLF was functioning again. That is why I stay with chansip for the time being.

Regards Frans

I am rolling out a pjsip-only system over the next two weeks, all latest builds of Asterisk & FreePBX, with Cisco SPA508G and Gigaset N300IP DECT.

I’ll let you know if I have any issues with BLF or anything else.

My other systems are all chan_sip only.

I’m using Voiceflex in the UK for the trunk.

1 Like

I think that it would be helpful to the community to have a FreePBX site based “Asterisk Discussion Forum” for Asterisk only issues, possible modifications to be vetted and possibly resolved or passed along to the Asterisk developer world.

This would not be counted on for problem resolution or support and would be very helpful and educational in our consideration of moving to new versions of Asterisk. It would be a nice place to refer Asterisk issues which pop up in other forums for discussion in addition to referring them to the Asterisk support forums.

Thanks, that is a great upgrade since I last visited the Asterisk Community. Lots of detail there.

In looking over the submissions, I am still left with some way to gain perspective on the status of Asterisk and the FreePbx Distro. Possibly more frequent newsy updates on where Asterisk and FreePbx are and are headed, as has been done in the past, would be helpful. I am feeling an sense of an information vacuum at the moment.

Any other sources you think I should monitor?

we have also tried bringing up two new systems using pjsip but were unsuccessful and had to revert to chan sip. we like others on here read about pjsip being the way of the future and wanted to start using it. based on these experiences we will shelve our pjsip effort for a while to see if it matures. the only thing i wish that sangoma would do is revert the defaults in the distro to use 5060 for chan sip.

You can change the channel driver from “both” to “chan_sip” in advanced settings. Then it will not be necessary to choose chan_sip when setting up a device, and the port will be 5060 etc.

yes i know we can do that, but it is just one more step to forget when spinning up a new system. but thanks for the reminder

I’m not surprised to hear that PJSIP is still not ready for primetime. It’s a complete re-write of the SIP stack, and there’s going to be a very long testing period. I doubt that Chan_SIP will go away until PJSIP is stable, if it does, everyone will just stick with an older version of Asterisk that still has it.

I understand why the FreePBX devs included such language in the FreePBX UI, but I think you’re worried about something you needn’t worry about.

For now, I’m continuing to use Chan_SIP.

Yeah it’s pretty easy to choose, and nice to have the choice!

I see it was a quite a few months ago since the last post on this thread. I’m curious if anyone out there is feeling comfortable setting up PJSIP based servers in enterprise. My gut feeling is to go chan_sip and give it another year or two. What does anyone out there think? Any success stories out there with PJSIP?

I haven’t tried to use PJ Sip as the main system channel since my first post here, I have tried using PJ Sip as a backup channel to support transfers back across remote PBX’s and that has worked fine although recovery from a network drop out still seems to be quite a problem.

Regards Paul

Recovery from a network dropout will always be an issue until nothing is using chan sip

In my experience chan_sip will make a full recovery once the connection becomes available, it’s PJSip that I have had to keep making manual interventions for.

Paul

Just like to report some PJSIP findings:

BLF + Directed Pickup on Cisco SPA handsets requires a very obscure configuration to work with PJSIP. This is nothing like what the Internet says about configuring SPA phones with Asterisk. (http://www.css-networks.com/2016/03/cisco-spa-blf-call-pickup-not-working-with-asterisk-13/ )

Gigaset cordless handsets do not give Ringback tone. i.e. the incoming caller doesn’t know that your Gigaset phone is indeed ringing.

pjsip parts of Asterisk segfault if it doesn’t like your attempts at configuring e.g. an IP-authenticated (no user/pass) trunk.

For these reasons, and lack of experience on both my part and what’s out there when I have these problems and start Googling, I am sticking with chan_sip for now. Even though chan_sip ruined my life for months between ~October and December 2015 (https://issues.asterisk.org/jira/browse/ASTERISK-25476 - the “Yealink problem” that was never a Yealink problem).

I hope you provided back traces to the digium team. Otherwise you are helping no one.

Ha. I half expected that response. It’s a simple report from the field, and is helping those who want an easy life.

Or I could just keep my findings to myself, given that I haven’t had the chance or opportunity to provide back traces to Digium.