Trunk between chan_pjsip and chan_sip


#1

I have an Asterisk server running version 15.4 with chan_pjsip(CLI without GUI), and would like to setup a trunk between it and another freepbx server that runs chan_sip(Freepbx with GUI). I’ve been trying every online examples but seems I’m not getting it. Currently, I’m getting the error below whenever I reload asterisk:
**
[2018-09-13 23:12:15] WARNING[1518]: res_pjsip_outbound_registration.c:1006 handle_registration_response: Fatal response ‘403’ received from ‘sip:lagospbx@10.33.67.9:5060’ on registration attempt to ‘sip:lagospbx@10.33.67.9:5060’, stopping outbound registration**

Below are my configuration:
PJSIP.CONF

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
local_net=10.32.0.0/16
local_net=127.0.0.1/32
external_media_address=xxx.xxx.xxx.xxx
external_signaling_address=xxx.xxx.xxx.xxx

[lagospbx]
type=registration
;transport=transport-udp
server_uri=sip:lagospbx@10.33.67.9:5060
client_uri=sip:lagospbx@10.33.67.9:5060
outbound_auth=lagospbx
auth_rejection_permanent=no


[lagospbx]
type=auth
auth_type=userpass
username=lagospbx
password=xxxxxxxxx
;realm=10.33.67.9

[lagospbx]
type=aor
contact=sip:10.33.67.9:5060
max_contacts=1
qualify_frequency=60

[lagospbx]
type=endpoint
transport=transport-udp
context=NaatCast-1
disallow=all
allow=ulaw
outbound_auth=lagospbx
aors=lagospbx
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
;from_user=1badan
;direct_media=no
;from_doman=10.33.67.9

[lagospbx]
type=identify
endpoint=lagospbx
match=10.33.67.9

SORCERY.CONF

[res_pjsip] ; Realtime PJSIP configuration wizard
endpoint=config,pjsip.conf,criteria=type=endpoint
endpoint=realtime,ps_endpoints
auth=config,pjsip.conf,criteria=type=auth
auth=realtime,ps_auths
aor=config,pjsip.conf,criteria=type=aor
aor=realtime,ps_aors
domain_alias=realtime,ps_domain_aliases
;contact=realtime,ps_contacts
;contact=config,pjsip.conf,criteria=type=contact
 
[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
identify=config,pjsip.conf,criteria=type=identify

EXTCONFIG.CONF

[settings]
ps_endpoints => odbc,asterisk
ps_auths => odbc,asterisk
ps_aors => odbc,asterisk
ps_domain_aliases => odbc,asterisk
ps_endpoint_id_ips => odbc,asterisk

And for the Freepbx chan_sip, below are the settings:


#2

xxxxxxxxx is not the same as 1234ibadan!

You don’t need insecure=invite. Once the registration is working it will just make it unnecessarily insecure.


#3

@david551 I did not use xxxxxxxxx in my configuration. I wanted to hide the password, that’s why I used xxxxxxxxx


#4

You didn’t hide 1234ibadan, and I would expect that rather than xxxxxxxxx.

Basically, if you are obfuscating information you need to obfuscate it in a way that still makes equal values equal and different ones different.


#5

@david551 now it’s hidden. Please ignore that and help take a second look at my setup. What could be the issue?


#6

I would get a SIP trace and see what is actually being sent in the rejected REGISTER. You’ve got a mix of chan_sip and chan_pjsip, and I’m only really familiar with the former, and with SIP itself.


#7

No joy yet on this. Please anyone with a solution on how I can successfully make trunk between chan_sip and chan_pjsip work? I guess the issue might be how to configure the freepbx to act like a SIP provider and authenticate the pjsip registration attempt.
Please anyone with solution would be highly appreciated.


#8

I don’t have a guide or anything but I know of people doing it - it’s all in the configuration and as @david551 mentioned seeing the actual traffic can show where the problem is.


#9

Below is the registration attempt, and that’s the only trace I kept seeing. There is no response to show what the issue is.


#10

If there is no response at all then you need to confirm the target is the correct address and perform a packet capture on the remote side.


#11

I actually captured this trace on the remote asterisk server. Let me try and capture on the local server as well.


#12

Have you confirmed that there is no firewall blocking the traffic? Does it show up in Asterisk?


#13

Actually the local asterisk server is behind a router but port forwarded to the 10.32.0.5 IP address from the router public IP. Now below is the trace from the local asterisk server:


#14

You can’t REGISTER as lagospbx because you have a “host” set. If you want to register then it has to be set to dynamic.


#15

Okay, I changed to host=dynamic and still getting same error. And I added registration string but still same error too. Is there a particular way I needed to configure the freepbx to act like SIP provider or what am I doing wrong?


#16

This forum isn’t focused on FreePBX, that has its own forum elsewhere. I have no experience with it and can’t comment on that.


#17

Wowwwwww. Thanks @jcolp. It works!! I changed the type to friend and bang, it’s REGISTERED