New tool to assist converting from SIP to PJSIP

Matt Brooks

Matt Brooks

Today, FreePBX has two options for setting up SIP connectivity, chan_sip and chan_pjsip. But, this won’t always be the case as Asterisk and FreePBX move closer to removal of chan_sip.

On the Asterisk front, chan_sip has already been marked as deprecated within the latest release. This is due to the fact that the older chan_sip channel driver was built in a way that makes it hard to make changes without breaking existing functionality. Deprecation does not mean that it has been removed, but it does mean that no bug fixes or security fixes are being added to the chan_sip channel driver. The chan_pjsip channel driver, on the other hand, does receive direct attention from Sangoma. If the chan_pjsip channel driver is used, you can rest assured that bugs will be worked on, security fixes will be applied, and new features will be added.

As FreePBX ages, the FreePBX team can not guarantee that the chan_sip channel driver will be as reliable as it is today. And if issues start to occur with chan_sip, there is also no guarantee that the FreePBX team will fix them. If you’re currently running chan_sip, save yourself some future headache and convert to chan_pjsip!

Luckily, the FreePBX team has created a couple of tools to help make the conversion process from chan_sip to chan_pjsip easy!

PJSIP Conversion Using the GUI

If you don’t have a lot of extensions that need to be converted, then the PJSIP conversion tool found in the GUI is the perfect solution for converting a single extension.

To convert an extension from chan_sip to chan_pjsip in the GUI, first open the extensions page (found under the Applications -> Extensions menu) and select the extension to edit.

Next click on the Advanced tab to show the advanced settings.

Click on the “Change To PJSIP Driver” button to start the conversion process to PJSIP.
change to pjsip driver
Note: A warning should be displayed after clicking the button. Please read and understand the warning to decide if you wish to continue with the conversion.

Finally, click on the ‘Apply Config’ button to apply the change to the live system.
apply config

And that’s it! Just repeat this process for each extension you want to convert.

PJSIP Conversion Using the CLI

For systems that have several extensions that need to be converted, the ‘convert2pjsip’ command can be used. The ‘convert2pjsip’ command is available in FreePBX 15 running the core module version 15.0.9.88 and higher.

Command Options:
fwconsole convert2pjsip [-a|–all] [-r|–range RANGE]

To convert all chan_sip extensions to chan_pjsip:

[root@freepbx ~]# fwconsole convert2pjsip -a
Converted extension 6040 to PJSIP
Converted extension 6041 to PJSIP
Converted extension 6042 to PJSIP
Converted extension 6043 to PJSIP
Converted extension 6044 to PJSIP
Converted extension 6045 to PJSIP
Converted extension 6969 to PJSIP
Converted extension 6970 to PJSIP
Converted extension 7070 to PJSIP
Converted extension 7071 to PJSIP
Converted extension 906969 to PJSIP
Converted extension 906970 to PJSIP
Extensions converted successfully!
Run ‘fwconsole reload’ to reload config

 

To convert a specific chan_sip extension to chan_pjsip:

[root@freepbx ~]# fwconsole convert2pjsip -r 6040
Converted extension 6040 to PJSIP
Extensions converted successfully!
Run ‘fwconsole reload’ to reload config

 

To specify a range of extensions to convert to chan_pjsip:

[root@freepbx ~]# fwconsole convert2pjsip -r 6000-6100
Converted extension 6040 to PJSIP
Converted extension 6041 to PJSIP
Converted extension 6042 to PJSIP
Converted extension 6043 to PJSIP
Converted extension 6044 to PJSIP
Converted extension 6045 to PJSIP
Extensions converted successfully!
Run ‘fwconsole reload’ to reload config

 

To specify multiple chan_sip extensions or ranges for conversion to chan_pjsip, use a comma:

[root@freepbx ~]# fwconsole convert2pjsip -r 7070,7071,6000-6100
Converted extension 6040 to PJSIP
Converted extension 6041 to PJSIP
Converted extension 6042 to PJSIP
Converted extension 6043 to PJSIP
Converted extension 6044 to PJSIP
Converted extension 6045 to PJSIP
Converted extension 7070 to PJSIP
Converted extension 7071 to PJSIP
Extensions converted successfully!
Run ‘fwconsole reload’ to reload config

Conclusion

I hope this article shows you the conversion tools available in FreePBX that can help assist in the conversion of extensions from the legacy chan_sip channel driver to the chan_pjsip channel driver.

Share this Blogpost

Share on email
Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on tumblr
Share on telegram

Start the Discussion

Sign up for our Newsletter

Scroll to Top