Moving from SIP to PJSIP

Hi

I’m looking to implement any new providers using PJSIP.

I have several trunks from a single provider. In the case at hand, I’m trying to get three trunks working - but this equally applies if you are trying to get two trunks going to the same provider.

Using chan_sip this works with the following configuration:

Outgoing

Trunk Name: 11111111
Peer Details:
username=11111111
type=peer
sendrpid=pai
secret=********
qualify=yes
port=5060
host=123.123.123.123
fromuser=11111111
dtmfmode=inband
disallow=all
context=from-trunk
allow=alaw&ulaw

Inbound
Register String: 11111111:********@123.123.123.123:5060/11111111

The seconds trunk is configured as:

Outgoing

Trunk Name: 11111112
Peer Details:
username=11111112
type=peer
sendrpid=pai
secret=********
qualify=yes
port=5061
host=123.123.123.123
fromuser=11111112
dtmfmode=inband
disallow=all
context=from-trunk
allow=alaw&ulaw

Inbound
Register String: 11111112:********@123.123.123.123:5061/11111112

In summary, they are:

  • all registered to the same IP Address
  • Each registration is to a unique port

This works well, with no issues…

However when migrating to PJSIP, I have tried various approaches; but all inbound calls appear to hit the last registered number…

Within each of the PJSIP trunks I have tried to set the Server and Client URL to be:

and have set the AOR Contact to be:

  • sip:123.123.123.123:5060
  • sip:123.123.123.123:5061

But to date, all changes have had the same result - the inbound call appears on the last trunk to register against our provider.

Ive also tried changing the endpoint identifier order to:

endpoint_identifier_order = auth_username,username,ip,anonymous

However, same result.

Any ideas?

Cheers

You want to configure the “line” parameter:

Thanks, that got it sorted…

@lgaetz I see you reported an issue for this, based on the thread that @avayax provided - https://issues.freepbx.org/browse/FREEPBX-14812, while it says it is released; I cant see where I would set the ‘line’ parameter?

The line param should be enabled by default:

[root@34693894 ~]# asterisk -x "pjsip show registration fpbx-1-xxxxxxxxxx" | grep line
 line                     : true

Not in my case:

pjsip show registration 12345678

 <Registration/ServerURI..............................>  <Auth..........>  <Status.......>
==========================================================================================

 12345678/sip:[email protected]:5062               12345678          Registered

 ParameterName            : ParameterValue
 ===========================================================
 auth_rejection_permanent : true
 client_uri               : sip:[email protected]:5062
 contact_user             : 12345678
 endpoint                 :
 expiration               : 3600
 fatal_retry_interval     : 0
 forbidden_retry_interval : 0
 line                     : false
 max_retries              : 10
 outbound_auth            : 12345678
 outbound_proxy           :
 retry_interval           : 60
 server_uri               : sip:[email protected]:5062
 support_path             : false
 transport                : 0.0.0.0-udp

Did you see the part of the ticket where it says this is a FreePBX 14 only feature?

tbh, I was confused around that…

Affected version was 13, then changed to 14?

Target version is 15.

Release was 13.0.119.12, and I thought all 14 releases were 14.xx.xx.xx?

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