chan_pjsip’s design philosophy is radically different from chan_sip. An explanation of why this is, is sort of detailed in this article:
Asterisk: Moving on from chan_sip | No Jitter
“One of the most important decisions made in the development of the new functionality was to design both a channel driver as well as a suite of dynamically loadable modules that comprise a full SIP stack. The channel driver would be a relatively slim module, while each module in the suite would provide a specific piece of functionality. The design structure of this stack is such that functionality can be added, modified, or removed with minimal impact on other modules.”
To put this in perspective, this is actually a very old debate in computer science and in operating system design. For example let’s take FreeBSD. Originally with the early versions of FreeBSD if you wanted to support a particular piece of hardware you had to recompile the kernel and switch on a define that would add support for that device into the kernel. You could also go through the kernel and switch off all the support for hardware you DIDN’T have and recompile the kernel.
The advantage of doing this is the kernel would be very small and fast, with the least memory footprint. This is how Walnut Creek in it’s heyday supported over 2000 (yes that’s two thousand) SIMULTANEOUS ftp client transfers on a single Xeon PC server - a feat that Linux has never been able to duplicate since. The disadvantage was that recompiling the kernel was an advanced undertaking that wasn’t beyond the skills of an administrator but was definitely way beyond the skills of a mere user.
Thus enter Loadable Kernel Modules into FreeBSD. Now, you merely had to boot the kernel with a directive to load a LKM for your hardware and voila - support. It also easily allowed companies that wanted to hide their hardware to distribute object modules only without source. Of course the downside of that was those companies often did not bother maintaining and recompiling their LKM’s for newer OS versions but at least you could use your gadget for a few iterations of the OS.
chan_pjsip is like the LKM approach in FreeBSD. It WOULD have been completely possible to refactor chan_sip into what chan_pjsip is today and that is undoubtedly what would have been done - if the chan_pjsip stack hadn’t already existed. (of course, doing that would have made the USECALLMANGER patch un-applyable) Since it did exist the Asterisk developers made the obvious decision to go that direction. Unfortunately, some of the Asterisk developers are somewhat religious zealots. It wasn’t enough to just add in support for a new channel driver and let people just naturally migrate over to it because it was better. No, to a Zealot, life isn’t good unless you can beat the living sheet out of people and FORCE them into The One True Way. So, cooler headed voices - such as the author of the above article - who said, I quote:
“A new SIP channel driver can exist in parallel to the legacy chan_sip channel driver. This approach would give the Asterisk community more time to test and adopt the new channel driver, while maintaining the existing functionality in chan_sip.”
were snowballed and beaten into the asphalt by the Zealots who ripped chan_sip out of the Asterisk tree when it became apparent that not every last person in the world wasn’t migrating over to chan_pjsip as fast as they wanted them to.
The Zealot’s excuse was “whine whine whine whaaaaaa it’s beyond our (pea) brains to maintain 2 separate channel drivers” completely ignoring the FACT that the moment they tore out chan_sip that one of the Asterisk developers (InterLink1) immediately posted it on github and updated it for Asterisk 21. Apparently he has more Asterisk development cojones in his little finger than all the Zealots put together have in their entire collective bodies - but I digress.
Indeed, one of the actual benefits of discarding chan_sip was in essence it “froze” development on chan_sip. Now, anytime anyone has some new scheme they want to do in SIP they have to figure out how to stuff it into chan_pjsip. So that is, actually, a good thing for efforts like the USECALLMANAGER patch. Because now, there’s no more need to modify the USECALLMANAGER patch. It’s development is over since development on chan_sip is over. As has been pointed out by jcolp, it really needs to be ported to chan_pjsip.
Except, that there is a problem. Unfortunately. There ALWAYS is a problem, we just can’t have nice stuff.
The problem is that the Cisco callmanager phones - which contrary to popular belief are NOT going away anytime soon (or Cisco wouldn’t have written the multiplatform 3PCC firmware) expect ALL modules to be ready and active in Asterisk at all times. I don’t know why this is - whether the phone are constantly polling for status or some such - but the Callmanager Patch developer knows - or at least, he did know at one time, when he wrote the patch. (I assume that’s WHY he selected chan_sip to patch) But for this to work with pjsip would mean ALL modules in chan_pjsip would need to be loaded at startup and remain active in memory at all times. Which if you think about it - sort of completely defeats the purpose of chan_pjsip having loadable modules in the first place. In an optimal Asterisk situation, chan_pjsip would only load whatever modules are needed by the SIP devices that register in and dynamically load and unload them as needed changed on the phones and trunks. I’m NOT an Asterisk designer or expert in chan_pjsip so I don’t know if that is how it actually works - and clearly the author of the USECALLMANAGER patch isn’t either. Possibly chan_pjsip could be cudgeled into submission and load everything and keep it loaded all the time and thus make the Cisco Enterprise phones happy - but I don’t know. And, the CALLMANAGER patch author is apparently not interested in finding out, either.
I am personally working on creating a new patch from USECALLMANAGER that applies to the chan_sip channel driver that Interlink1 made available that applies to Asterisk 21. The problem is that Interlink1 didn’t just take the discarded channel driver and brush it up to apply cleanly to Asterisk 21. Would that it have been so easy!!! Sigh. Instead, he had some other fish to fry - which mainly concern updates to the channel driver that seem to make it more compatible with certain types of SIP trunks - that are incompatible with the USECALLMANAGER patch. However, it should be possible to produce a patch that reverses his updates that are not compatible and add in the USECALLMANAGER patch then produce a patched chan_sip that applies cleanly to Asterisk 21. I’ve been in communication with the author of the USECALLMANAGER patch to do this and he’s interested and helping a bit so we will see how that works out.
But, unfortunately, since Interlink1 made his changes, which are incompatible with the USECALLMANAGER patch, this does mean that the fork of chan_sip is going to bifurcate. I don’t like that since it means more work to maintain for what I personally regard as changes Interlink1 made that really aren’t anywhere near as important as support for the Cisco phones. Interlink1 for sure knew about USECALLMANAGER patch when he created his fork of chan_sip he for sure could have incorporated it if he wanted to. But, like I said, he had other fish to fry.
Ultimately what all this boils down to is a philosophical difference. Cisco has, in fact, already washed their hands of the entire situation and is not interested in refereeing in a Zealot war. They produced the 3PCC firmware which you can buy for not a lot of money, and update your CP8841 to a much more supported phone, there’s even “orficial” documentation for provisioning those phones here:
How to provision Cisco 8800 series 3PCC phones on FreePBX/PBXAct Endpoint Manager (EPM) - FreePBX Community Documentation - Sangoma Documentation (atlassian.net)
And there’s plenty more help here:
Configure SIP Settings on the Cisco IP Phone 8800 Series Multiplatform Phone - Cisco
I also personally have a CP8845 running the 3PCC firmware in my test lab and if all you have is ONE Cisco CP8841 then even I’ll advise you to just grit your teeth and buy the update.
The reality is that with effort you can find used CP8845 videophones for $25 off Fleabay and with an extra $35-$40 for the 3PCC firmware update you have a standards-compliant videophone that will have cost you $65 and will immediately sell on Fleabay for $100, and is equivalent to a brand new videophone costing several hundred dollars. The real use of the USECALLMANAGER patch, in my opinion, is supporting the OLDER phones like the CP8941 videophone which DO NOT have a multiplatform firmware update available from Cisco. There is Enterprise SIP firmware available - but most were loaded with SCCP firmware. While there IS a chan_sccp channel driver that works with those, that’s another story for another time.