Converting SIP Trunks to PJSIP Trunks

I am wanting to convert over to Asterisk 13 and PJSIP but I can’t seem to translate the SIP Trunk settings to a PJSIP Trunk that would actually register and take and make calls - Here is what I currently use in SIP:

Outgoing
Trunk Name: BluIP-Out
Settings:
username=XXXXXXXXXX
type=peer
trustrpid=yes
sendrpid=no
secret=SecretSquirrel
qualify=yes
outboundproxy=lax-iad3.masteraccess.com
nat=yes
host=lax-iad3.masteraccess.com
fromdomain=somewhere.com
dtmfmode=rfc2833
canreinvite=yes

Incoming:
Trunk-Name: BluIP-In
Settings:
username=XXXXXXXXXX
type=friend
trustrpid=yes
srvlookup=yes
sendrpid=no
secret=SecretSquirrel
qualify=yes
nat=yes
insecure=invite,port
host=lax-iad3.masteraccess.com
dtmfmode=rfc2833
disallow=all
context=from-pstn
canreinvite=yes
allow=ulaw

Register String:
[email protected]:SecretSquirrel:[email protected]/XXXXXXXXXX

I have read the Digium instructions but the translation into FreePBX just never registers - Has anyone else got this working? I don’t think our SIP trunks are weird but maybe they are.

And no, I can’t use SIP for the trunks in 13 - we get audio drops (they are using a Broadsoft - has anyone else seen that problem also?).

Ok - since no one else will answer this question, I will answer it myself - Note - this (finally) works registering against a Broadsoft switch - so some of the things might be unnecessary, but this is what was required to get it working against Broadsoft:



With these settings, the trunk registers and we can make calls in and out - Strangely, SRV lookup is not working - I had to switch to the IP of my provider. 199.168.179.168 is the ip for lax-iad3.masteraccess.com.

If anybody knows why SRV lookup is not working (Asterisk 13.3.1) let me know - but it works ok with the IP.

3 Likes

I used this page as the majority of my reference - although the client URI had to be adapted to what the Broadsoft was expecting:

https://wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip

1 Like

What IP address did you put into the client_uri field, your external IP?
And the port in that field, is that your local pjsip bind port?

I am answering myself, the client URI contains the IP address of the remote server.
I got confused by an error on the Asterisk wiki, which is now corrected.

“The server URI is how to reach the server you are registering to, and the client URI is the information about what you are registering to on that server.”

1 Like

Cool - I stopped using them because DTMF was not working - have you tested it?

You mean you stopped using PJSIP trunks because of DTMF and moved to chansip or did you ditch Broadsoft?

I have found that DTMF doesn’t work reliably with PJSIP. One of my first installs of FPBX Distro about two years ago I didn’t know better and had all the extensions setup as PJSIP. Many of the users complained about the menus of other systems they were calling not always recognising their key presses and after switching them to cha_sip the problems went away.

I am slowly “experimenting” with PJSIP again with the odd extension here and there over several client installs (particularly those that need to be able to be logged in to more than one device simultaneously), and so far no complaints fingers crossed

I am slipping in a few pjsip extensions here and there as well in a production environment. Gradually getting there.
Got a few trunks to PRI gateways moved to PJSIP as well.

Let’s see if the users complain about DTMF.

I meant that when a trunk was defined as PJSIP I couldn’t decode DTMF, but with the same provider, if I switched to CHAN_SIP, it worked fine - got too busy to screw around with it and left it alone for a while - I might try again with my new provider (NOT Broadsoft).

it also worked for me on FreePBX v14/Asterisk v13 with NexVortex provider.
Thank you very much for the detailed information.
All I had to do was insert our IP addresses, username and secret.
Everything worked like a charm!
Thank you, thank you!

1 Like

I have the same problem with converting the trunk from ChanSIP to PJSIP. The screenshots with the correct settings are no longer working. Could you upload them again or send a screenshot on my email ([email protected])?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.