Setting up SIP-trunk between asterisk SIP and asterisk PJSIP servers

Hi Guys,

I have build a new Asterisk 16-server on an ubuntu 16.04 machine.
The new server uses PJSIP and the old one uses SIP.
To be able to migrate to the new server I need a trunk between the old and the new server because I will not be able to migrate all offices at once.

So far I have this configuration :

New server using PJSIP_wizard.conf :

type = wizard
transport = trans-udp-nat
endpoint/allow_subscribe = no
endpoint/allow = !all,ulaw, alaw
aor/qualify_frequency = 30
registration/expiration = 1800

sends_auth = yes
sends_registrations = yes
remote_hosts = x.x.x.x ( I have verified this IP address is correct )
accepts_registrations = yes
endpoint/send_rpid = yes
endpoint/send_pai = yes
outbound_auth/username = user
outbound_auth/password = password 

old server using sip.conf :

register => user:password@correctIP:5060


In the extensions.conf on the new server I use :

exten => _1XX,1,GotoIf(${BLACKLIST()}?blocked)
       same => n,Dial(PJSIP/asterisk13/sip:${EXTEN}@correctip:5060)
       same => n,Answer()
       same => n,Playtones(busy);
       same => n,Busy(10)
       same => n,Hangup()

But so far I keep getting this error on the old server when trying to make a call from the new one routed to the old one.

[May 24 13:08:14] WARNING[43290][C-00001fca]: chan_sip.c:16564 check_auth: username mismatch, have <117>, digest has <ast>
[May 24 13:08:14] NOTICE[43290][C-00001fca]: chan_sip.c:25451 handle_request_invite: Failed to authenticate device "John Doe" <sip:117@IPofNewServer>;tag=8a6eaff3-c5ee-4c23-9e48-54df9d438372

On the new server I get this notice :

[May 24 13:19:25] NOTICE[35450]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'OPTIONS' from '"asterisk" <sip:asterisk@>' failed for '' (callid: 27b2e71c6b56424779a72b810b05c072@ - No matching endpoint found

Can anyone help me out on how to setup a trunk for this usecase between sip and pjsip ?
Thanks in advance.

As you are doing username/password you’ll want to set “endpoint/from_user” to “ast” so that the INVITE request gets matched by chan_sip to the “ast” entry. Without this it can end up getting matched to another, like has happened.

Alright, thanks Jcolp for the quick reply again !
I feel like I should buy you a beer or something for all the help you gave me.

Works like a charm again ! Thanks !

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