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:
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.
@david551 I did not use xxxxxxxxx in my configuration. I wanted to hide the password, that’s why I used xxxxxxxxx
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.
@david551 now it’s hidden. Please ignore that and help take a second look at my setup. What could be the issue?
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.
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.
jcolp
September 14, 2018, 3:47pm
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.
Below is the registration attempt, and that’s the only trace I kept seeing. There is no response to show what the issue is.
jcolp:
15:01:23.171649 IP 10.32.0.5.sip > NGVI-PABX1.it.vi.ng.smilecoms.com.sip: SIP, length: 536
E…4…@.>.H.
…
!C … .PREGISTER sip:10.33.67.9:5060 SIP/2.0
Via: SIP/2.0/UDP 10.32.0.5:5060;rport;branch=z9hG4bKPjaffe3fd5-1249-40e9-937d-4750b190877d
From: sip:lagospbx@10.33.67.9 ;tag=a6b74345-917d-4614-a2ab-ce4979518c40
To: sip:lagospbx@10.33.67.9
Call-ID: 150675e7-db20-4074-adcf-ba19d5dff278
CSeq: 59868 REGISTER
Contact: sip:s@10.32.0.5:5060
Expires: 3600
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Max-Forwards: 70
User-Agent: Asterisk PBX 15.4.0
Content-Length: 0
jcolp
September 14, 2018, 3:56pm
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.
I actually captured this trace on the remote asterisk server. Let me try and capture on the local server as well.
jcolp
September 14, 2018, 3:57pm
12
Have you confirmed that there is no firewall blocking the traffic? Does it show up in Asterisk?
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:
bayoojo1:
17:01:25.281965 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 200 OK
E…B…>…
!C
…SIP/2.0 200 OK
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPj0fa31e0f-4bea-4f75-b901-c35cc72d8fe2;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.32.0.5 ;tag=8dd9839e-ab56-403e-a6f9-87833d418006
To: sip:lagospbx@10.33.67.9 ;tag=as30744ac0
Call-ID: b97c36aa-0dfe-41ba-b06c-ac1d74b9cf19
CSeq: 49322 OPTIONS
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:10.33.67.9:5060
Accept: application/sdp
Content-Length: 0
17:01:43.889694 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 401 Unauthorized
E…a…>.~.
!C
…MA.SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPj4a75163a-940d-4a6f-a627-dff7c008e5cc;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.33.67.9 ;tag=5de5280c-e813-4609-b8bb-96089e6f05fb
To: sip:lagospbx@10.33.67.9 ;tag=as06a85cae
Call-ID: 68a58eaf-62d1-4486-a8ad-40cc88b4a0ec
CSeq: 52030 REGISTER
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“71dd32b4”
Content-Length: 0
17:01:43.907813 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 403 Forbidden
E…>…C
!C
…TSIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPj3f9a940e-f07e-4e03-b95f-49c86daec039;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.33.67.9 ;tag=5de5280c-e813-4609-b8bb-96089e6f05fb
To: sip:lagospbx@10.33.67.9 ;tag=as06a85cae
Call-ID: 68a58eaf-62d1-4486-a8ad-40cc88b4a0ec
CSeq: 52031 REGISTER
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
17:01:45.646730 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 200 OK
E…B…>…
!C
…SIP/2.0 200 OK
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPj7be00b32-3c71-4a9c-a431-f5b00dea6573;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.32.0.5 ;tag=207f6f8d-c880-4b68-9d80-e2e8bdec953f
To: sip:lagospbx@10.33.67.9 ;tag=as1836fd8d
Call-ID: e52bd899-2989-4238-995d-48195432dce4
CSeq: 22853 OPTIONS
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:10.33.67.9:5060
Accept: application/sdp
Content-Length: 0
17:02:45.647613 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 200 OK
E…B…>…
!C
…S.SIP/2.0 200 OK
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPjd740bc6f-a12c-4b24-b107-d5e0de3a7df3;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.32.0.5 ;tag=4b5d0a62-e562-4bcf-9382-67f1bff46bee
To: sip:lagospbx@10.33.67.9 ;tag=as4271ff76
Call-ID: b3cc051a-9218-4bab-a4fd-202cc4ac1816
CSeq: 38185 OPTIONS
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:10.33.67.9:5060
Accept: application/sdp
Content-Length: 0
jcolp
September 14, 2018, 4:09pm
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.
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?
17:16:22.618580 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 401 Unauthorized
E…a…>.~.
!C
…M…SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPjfafe8c35-43bf-43ee-82d8-1792d6954b88;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.33.67.9 ;tag=139f4ea5-60dc-4fda-bf19-8ba9c6c52915
To: sip:lagospbx@10.33.67.9 ;tag=as07976923
Call-ID: 68a58eaf-62d1-4486-a8ad-40cc88b4a0ec
CSeq: 52034 REGISTER
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“06b47f5e”
Content-Length: 0
17:16:22.632923 IP 10.33.67.9.sip > localhost.localdomain.sip: SIP: SIP/2.0 403 Forbidden
E…>…/
!C
…A.SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 154.66.4.250:5060;branch=z9hG4bKPjaacb6fca-30db-4614-bd65-4365f5e84a5c;received=10.32.0.5;rport=5060
From: sip:lagospbx@10.33.67.9 ;tag=139f4ea5-60dc-4fda-bf19-8ba9c6c52915
To: sip:lagospbx@10.33.67.9 ;tag=as07976923
Call-ID: 68a58eaf-62d1-4486-a8ad-40cc88b4a0ec
CSeq: 52035 REGISTER
Server: FPBX-2.11.0(11.25.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
jcolp
September 14, 2018, 4:26pm
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.
Wowwwwww. Thanks @jcolp . It works!! I changed the type to friend and bang, it’s REGISTERED
Hello @bayoojo1 , i have the same problem, how do you fix? Show me scritpt?
Thanks you
taner
February 16, 2019, 7:41pm
19
Hi, I find this guide:
I tested it and it works for now only for incomming calls.
But I see here freepbx sangoma use PJSIP trunk to communicate with Linksys Spa 3000.
In clear asterisk PJSIP trunk in gui is not available…
Someone can tell me how to use it to work with SPA 3000?
I tried sip trunk between spa 3000 and asterisk but doesn’t work.
Only free pbx sangoma with pjsip trunk works well…