"Does your service work with PJSIP?" I get this question once a week, at most. However, I am always astounded by the lack of knowledge brought to the table when I ask the logical question, "What is the use case for PJSIP?" Typically I get something along the lines of, "it's newer." Disregarding the fact that this is not a use case, it's also not a reason to utilize something. IPv6 is newer than IPv4, yet these same people are not retooling their networks to be fully run on IPv6.
What is SIP?
I hate to start here, but sadly I am still asked to provide "SIP Trucks" every day, along with being told, "my SIP is broken." This leads me to believe I must first explain a little about SIP. SIP is a protocol. Which, I think is best related to proper grammar and etiquette. In grade school you were taught how to form a sentence, and from there a paragraph, and eventually you branched out until you could convey a thought/idea of any complexity via some language in written form.
You also learned that there are formal and informal ways of expressing written thought depending on your interpretation of what the situation called for, or perhaps based on stylistic choices which you made. The Session Initiation Protocol (SIP) is a formalized way to manage communication over the internet. Two devices operating within the limits of the rules governing SIP, should generally be able to communicate with each other. SIP has been reviewed by many engineers, far smarter than myself and likely far smarter than you, and it is far from broken. One person plugging in their SIP capable endpoint cannot break their SIP. Either the device manufacturer/developer has interpreted and implemented the RFCs for SIP correctly and your device will work with other SIP devices, or they have not. There is not much room for middle ground.
What is CHAN_SIP?
Chan_sip is a channel driver used for SIP functionality in Asterisk based devices (and likely others) for years. A channel driver is what allows your device/software to communicate via some protocol (SIP, IAX, Skinny, etc). Chan_sip was developed when SIP was fairly new and prior to 2014 if you were communicating via SIP it is extremely likely that some device in that conversation was operating with chan_sip.
It is the only SIP channel driver in Asterisk version 11 and lower. Starting in Asterisk version 12, you have access to chan_sip and chan_pjsip. Many people are still using chan_sip because it is well known, stable, time-tested, and supports all of the features they need for regular SIP communications. However, it is not easy to modify for new feature support, and is going to be surpassed by chan_pjsip in the future, in terms of number of devices using it, and number of developers extending it, customizing it, and reviewing it.
What is CHAN_PJSIP?
PJSIP is a library which has become the foundation for the chan_pjsip channel driver in Asterisk version 12 and higher. You can use chan_pjsip by itself, or in parallel with chan_sip (if you know what you are doing). PJSIP is very modular and a change to one module does not affect the others. In other words, the developers of Asterisk (or any other communications platform using PJSIP) can add (or remove) features much more easily and have less risk of introducing a bug.
Presently chan_pjsip is relatively new, yet an increasing number of Asterisk based systems are choosing chan_pjsip as the default SIP channel driver. Ultimately it doesn't require much adaptation from end-users on GUI based systems (FreePBX, Yeastar, Grandsteram, etc), but it does have a small learning curve for non GUI systems users (see this website for an overview and some examples).
The current feature set for the PJSIP library can be found here
If you want to get more detailed information or even inspect the source code yourself you can visit www.pjsip.org
Parting Thoughts:
If you need some new SIP feature, or are using some newer module on your Asterisk server, you are likely going to choose chan_pjsip out of necessity. If you'd like to see what all the buzz is about, but are concerned for your safety; just remember, you cannot break SIP, and chan_pjsip should work for pretty much every use case where chan_sip already works. If you are just using SIP for VoIP and don't need anything beyond typical telephony features chan_sip should work for you for years to come.
Ryan Rudolf Oba
ITIL, RHCSA, A+ || ryanrudolfoba.com
im a newbie with all of this, just started playing with IncrediblePBX (asterisk 13) on my homelab environment over the weekend. i've configured it to use chan_sip but having second thoughts if using the newer chan_pjsip will be better, efficient, (insert all shiny good adjectives here). but reading your article, looks like chan_sip will fit with my use case scenario. im using it for VoIP for my android phone using bria / groundwire client. thoughts?
8 个月Ted Mittelstaedt
Owner, Portlandia IT
"Ultimately it doesn't require much adaptation from end-users on GUI based systems (FreePBX, Yeastar, Grandsteram, etc)," The adaptation needs to be from the developers and end users really need to know that not all of the developers get it right. For example "old style" SIP connections that use authentication based on IP address instead of registration and userID/password authentication don't seem to work on pjsip - probably because the developers aren't setting up pjsip properly in their GUI configurators. FreePBX does allow for running both chan_sip and chan_pjsip at the same time, so that is one way of solving it. (one of them is run on a non-standard port) While this may not be an issue for SIP trunks supplied over the Internet it may be a big issue for older SIP devices (gateways, etc.)
2 年前Kent Adams
Director of Engineering at SIP.US
The SIP library used by the extension would not affect the quality of the audio delivered, except that you could constrain or expand codec selection based on the endpoint characteristics. Most likely choppy audio is going to be bandwidth, latency, or CPU usage related. I believe I have an article on here that talks about troubleshooting this type of issue if you can find it!
10 个月Johann Zuerner
at SaSeWind
In my case I have just recently starting introducing a few pjsip extension to my FreePBX 13 install, as well as a PJSIP trunk to another PBX, and my users complain about choppy audio on calls. I wonder if it could have to do with my mix of pjsip and chansip.
10 个月