Sip trunk authentication credentials

Good day,

I am trying to connect 2 asterisk servers so that they can call each others endpoints using sip trunk, but i am getting an authentication error please help if anyone familiar with this error:

– Executing [6001@sip_trunk:1] Ringing(“PJSIP/6010-00000000”, “”) in new stack
– Executing [6001@sip_trunk:2] Dial(“PJSIP/6010-00000000”, “PJSIP/6001@mytrunk,25”) in new stack
– Called PJSIP/6001@mytrunk
[Jun 1 06:39:24] WARNING[19257]: res_pjsip_outbound_authenticator_digest.c:193 digest_create_request_with_auth: Endpoint: ‘mytrunk’: Authentication credentials not accepted by server.
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [6001@sip_trunk:3] Hangup(“PJSIP/6010-00000000”, “”) in new stack
== Spawn extension (sip_trunk, 6001, 3) exited non-zero on ‘PJSIP/6010-00000000’

Server A pjsip.conf:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[mytrunk]
type=endpoint
context=sip_trunk
disallow=all
allow=g722,ulaw
outbound_auth=mytrunk
aors=mytrunk

[mytrunk]
type=auth
auth_type=userpass
password=mytrunk
username=mytrunk

[mytrunk]
type=aor
contact=sip:192.168.10.10:5060
max_contacts=10

[mytrunk]
type=registration
outbound_auth=mytrunk
expiration=300
auth_rejection_permanent=no
retry_interval=30
forbidden_retry_interval=60
fatal_retry_interval=120
max_retries=120
server_uri=sip:192.168.10.10
client_uri=sip:mytrunk@192.168.10.10

[mytrunk]
type=identify
match=192.168.10.10
endpoint=mytrunk
auth_username=mytrunk

server B pjsip.conf:

[mytrunk]
type = auth
auth_type = userpass
username = mytrunk
password = mytrunk

[mytrunk]
type = aor
max_contacts = 10

[mytrunk]
type = endpoint
context =sip_trunk
allow = !all,ulaw
direct_media = no
auth = mytrunk
aors = mytrunk

[mytrunk]
type = identify
match = 192.168.42.14
endpoint = mytrunk

When i try to make a call i also receive failed to authentication on server B

1 Like

You would need to provide complete configuration (if this isn’t it) as well as show both Asterisk instances and the underlying SIP traffic (pjsip set logger on).

Hey jcolp,
Kindly see the below results when i try to make a call from asterisk server A endpoint to server B endpoint while pjsip set logger on:

*CLI> <— Received SIP request (1156 bytes) from UDP:10.0.10.168:5062 —>
INVITE sip:6001@192.168.42.14 SIP/2.0
Via: SIP/2.0/UDP 10.0.10.168:5062;branch=z9hG4bK1000196627;rport
Route: sip:192.168.42.14:5060;lr
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
CSeq: 240 INVITE
Contact: “amin” sip:6010@10.0.10.168:5062
Max-Forwards: 70
User-Agent: Grandstream GXP1625 1.0.4.128
Privacy: none
P-Preferred-Identity: “amin” sip:6010@192.168.42.14
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=C0-74-AD-01-37-EF
Supported: replaces, path, timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 400

v=0
o=6010 8000 8000 IN IP4 10.0.10.168
s=SIP Call
c=IN IP4 10.0.10.168
t=0 0
m=audio 5006 RTP/AVP 0 8 4 18 9 97 2 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:2 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

<— Transmitting SIP response (482 bytes) to UDP:10.0.10.168:5062 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.10.168:5062;rport=5062;received=10.0.10.168;branch=z9hG4bK1000196627
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14;tag=z9hG4bK1000196627
CSeq: 240 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1591170583/a89ae0f0dd2c81f01f6e87cbbaea478a”,opaque=“2c9f12734a0968e1”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 17.1.0
Content-Length: 0

<— Received SIP request (325 bytes) from UDP:10.0.10.168:5062 —>
ACK sip:6001@192.168.42.14 SIP/2.0
Via: SIP/2.0/UDP 10.0.10.168:5062;branch=z9hG4bK1000196627;rport
Route: sip:192.168.42.14:5060;lr
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14;tag=z9hG4bK1000196627
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
CSeq: 240 ACK
Content-Length: 0

<— Received SIP request (1428 bytes) from UDP:10.0.10.168:5062 —>
INVITE sip:6001@192.168.42.14 SIP/2.0
Via: SIP/2.0/UDP 10.0.10.168:5062;branch=z9hG4bK299706571;rport
Route: sip:192.168.42.14:5060;lr
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
CSeq: 241 INVITE
Contact: “amin” sip:6010@10.0.10.168:5062
Authorization: Digest username=“mytrunk”, realm=“asterisk”, nonce=“1591170583/a89ae0f0dd2c81f01f6e87cbbaea478a”, uri="sip:6001@192.168.42.14", response=“e8d667d6f6f64197e5e252e1310b71a7”, algorithm=md5, cnonce=“14918364”, opaque=“2c9f12734a0968e1”, qop=auth, nc=00000001
Max-Forwards: 70
User-Agent: Grandstream GXP1625 1.0.4.128
Privacy: none
P-Preferred-Identity: “amin” sip:6010@192.168.42.14
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=C0-74-AD-01-37-EF
Supported: replaces, path, timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 400

v=0
o=6010 8000 8000 IN IP4 10.0.10.168
s=SIP Call
c=IN IP4 10.0.10.168
t=0 0
m=audio 5006 RTP/AVP 0 8 4 18 9 97 2 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:2 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

== Setting global variable ‘SIPDOMAIN’ to ‘192.168.42.14’
<— Transmitting SIP response (307 bytes) to UDP:10.0.10.168:5062 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.10.168:5062;rport=5062;received=10.0.10.168;branch=z9hG4bK299706571
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14
CSeq: 241 INVITE
Server: Asterisk PBX 17.1.0
Content-Length: 0

– Executing [6001@sip_trunk:1] Ringing(“PJSIP/6010-00000002”, “”) in new stack
– Executing [6001@sip_trunk:2] Dial(“PJSIP/6010-00000002”, “PJSIP/6001@mytrunk,25”) in new stack
<— Transmitting SIP response (496 bytes) to UDP:10.0.10.168:5062 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.0.10.168:5062;rport=5062;received=10.0.10.168;branch=z9hG4bK299706571
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14;tag=81e89f53-eeb0-47fc-bb17-f6449eb93624
CSeq: 241 INVITE
Server: Asterisk PBX 17.1.0
Contact: sip:192.168.42.14:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Content-Length: 0

– Called PJSIP/6001@mytrunk
<— Transmitting SIP request (927 bytes) to UDP:192.168.10.10:5060 —>
INVITE sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10
Contact: sip:asterisk@192.168.42.14:5060
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6663 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Type: application/sdp
Content-Length: 263

v=0
o=- 268483615 268483615 IN IP4 192.168.42.14
s=Asterisk
c=IN IP4 192.168.42.14
t=0 0
m=audio 15042 RTP/AVP 0 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Received SIP response (576 bytes) from UDP:192.168.10.10:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
CSeq: 6663 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1591170583/76a02337d239de4615f7e6b1187ef754”,opaque=“665a8390619f4ab0”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 17.2.0
Content-Length: 0

<— Transmitting SIP request (435 bytes) to UDP:192.168.10.10:5060 —>
ACK sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6663 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Length: 0

<— Transmitting SIP request (1228 bytes) to UDP:192.168.10.10:5060 —>
INVITE sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10
Contact: sip:asterisk@192.168.42.14:5060
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6664 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Authorization: Digest username=“mytrunk”, realm=“asterisk”, nonce=“1591170583/76a02337d239de4615f7e6b1187ef754”, uri=“sip:6001@192.168.10.10:5060”, response=“4df20dbc66387cc505f158f59119f693”, algorithm=md5, cnonce=“cebced9492784948aea4c31ecc5b23d8”, opaque=“665a8390619f4ab0”, qop=auth, nc=00000001
Content-Type: application/sdp
Content-Length: 263

v=0
o=- 268483615 268483615 IN IP4 192.168.42.14
s=Asterisk
c=IN IP4 192.168.42.14
t=0 0
m=audio 15042 RTP/AVP 0 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Received SIP response (374 bytes) from UDP:192.168.10.10:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10
CSeq: 6664 INVITE
Server: Asterisk PBX 17.2.0
Content-Length: 0

<— Received SIP response (562 bytes) from UDP:192.168.10.10:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=50657510-e8d8-493f-8b30-a4fc98fc6aca
CSeq: 6664 INVITE
Server: Asterisk PBX 17.2.0
Contact: sip:192.168.10.10:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Content-Length: 0

– PJSIP/mytrunk-00000003 is ringing
– PJSIP/mytrunk-00000003 is ringing
<— Transmitting SIP response (496 bytes) to UDP:10.0.10.168:5062 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.0.10.168:5062;rport=5062;received=10.0.10.168;branch=z9hG4bK299706571
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14;tag=81e89f53-eeb0-47fc-bb17-f6449eb93624
CSeq: 241 INVITE
Server: Asterisk PBX 17.1.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Contact: sip:192.168.42.14:5060
Content-Length: 0

<— Received SIP request (900 bytes) from UDP:192.168.10.10:5060 —>
INVITE sip:6001@192.168.42.14:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.10:5060;rport;branch=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
From: “amin” sip:6010@172.17.0.1;tag=fa3de96b-22d8-4ffa-9b4f-1576cb8998f9
To: sip:6001@192.168.42.14
Contact: sip:asterisk@192.168.10.10:5060
Call-ID: 8ef0558d-ac2e-4a0e-bcc3-ffa39609864a
CSeq: 23783 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.2.0
Content-Type: application/sdp
Content-Length: 239

v=0
o=- 1507031352 1507031352 IN IP4 192.168.10.10
s=Asterisk
c=IN IP4 192.168.10.10
t=0 0
m=audio 15400 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Transmitting SIP response (572 bytes) to UDP:192.168.10.10:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.10.10:5060;rport=5060;received=192.168.10.10;branch=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
Call-ID: 8ef0558d-ac2e-4a0e-bcc3-ffa39609864a
From: “amin” sip:6010@172.17.0.1;tag=fa3de96b-22d8-4ffa-9b4f-1576cb8998f9
To: sip:6001@192.168.42.14;tag=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
CSeq: 23783 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1591170583/c941a01479250fc6cf06fcd2356eb762”,opaque=“6112531c34747b43”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 17.1.0
Content-Length: 0

<— Received SIP request (433 bytes) from UDP:192.168.10.10:5060 —>
ACK sip:6001@192.168.42.14:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.10:5060;rport;branch=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
From: “amin” sip:6010@172.17.0.1;tag=fa3de96b-22d8-4ffa-9b4f-1576cb8998f9
To: sip:6001@192.168.42.14;tag=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
Call-ID: 8ef0558d-ac2e-4a0e-bcc3-ffa39609864a
CSeq: 23783 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 17.2.0
Content-Length: 0

<— Received SIP response (553 bytes) from UDP:192.168.10.10:5060 —>
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=50657510-e8d8-493f-8b30-a4fc98fc6aca
CSeq: 6664 INVITE
Server: Asterisk PBX 17.2.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Reason: Q.850;cause=21
Content-Length: 0

<— Transmitting SIP request (426 bytes) to UDP:192.168.10.10:5060 —>
ACK sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=50657510-e8d8-493f-8b30-a4fc98fc6aca
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6664 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Length: 0

== Everyone is busy/congested at this time (1:0/0/1)
– Executing [6001@sip_trunk:3] Hangup(“PJSIP/6010-00000002”, “”) in new stack
== Spawn extension (sip_trunk, 6001, 3) exited non-zero on ‘PJSIP/6010-00000002’
<— Transmitting SIP response (486 bytes) to UDP:10.0.10.168:5062 —>
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 10.0.10.168:5062;rport=5062;received=10.0.10.168;branch=z9hG4bK299706571
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14;tag=81e89f53-eeb0-47fc-bb17-f6449eb93624
CSeq: 241 INVITE
Server: Asterisk PBX 17.1.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Reason: Q.850;cause=21
Content-Length: 0

<— Received SIP request (343 bytes) from UDP:10.0.10.168:5062 —>
ACK sip:6001@192.168.42.14 SIP/2.0
Via: SIP/2.0/UDP 10.0.10.168:5062;branch=z9hG4bK299706571;rport
Route: sip:192.168.42.14:5060;lr
From: “amin” sip:6010@192.168.42.14;tag=1656294478
To: sip:6001@192.168.42.14;tag=81e89f53-eeb0-47fc-bb17-f6449eb93624
Call-ID: 1880264498-5062-29@BA.A.BA.BGI
CSeq: 241 ACK
Content-Length: 0

Server A pjsip.conf:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[mytrunk]
type=endpoint
context=sip_trunk
disallow=all
allow=g722,ulaw
outbound_auth=mytrunk
aors=mytrunk

[mytrunk]
type=auth
auth_type=userpass
password=mytrunk
username=mytrunk

[mytrunk]
type=aor
contact=sip:192.168.10.10:5060
max_contacts=10

[mytrunk]
type=registration
outbound_auth=mytrunk
expiration=300
auth_rejection_permanent=no
retry_interval=30
forbidden_retry_interval=60
fatal_retry_interval=120
max_retries=120
server_uri=sip:192.168.10.10
client_uri=sip:mytrunk@192.168.10.10

[mytrunk]
type=identify
match=192.168.10.10
endpoint=mytrunk
auth_username=mytrunk

[6010]
type=endpoint
context=sip_trunk
allow=!all,all
auth=6010
aors=6010

[6010]
type=auth
auth_type=userpass
password=mytrunk
username=mytrunk

[6010]
type=aor
max_contacts=1

[6011]
type=endpoint
context=sip_trunk
allow=!all,all
auth=6011
aors=6011

[6011]
type=auth
auth_type=userpass
password=mytrunk
username=mytrunk

[6011]
type=aor
max_contacts=1

server A extensions.conf:

[sip_trunk]
exten => _6XXX,1,Ringing()
same => n,Dial(PJSIP/${EXTEN}@mytrunk,25)
same => n,HangUp()

server B pjsip.conf:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[mytrunk]
type=auth
auth_type=userpass
username=mytrunk
password=mytrunk

[mytrunk]
type=aor
max_contacts=10

[mytrunk]
type=endpoint
context=sip_trunk
allow=!all,ulaw
direct_media=no
auth=mytrunk
aors=mytrunk

[mytrunk]
type=identify
match=192.168.42.14
endpoint=mytrunk

[6001]
type=endpoint
context=sip_trunk
allow=!all,all
auth=6001
aors=6001

[6001]
type=auth
auth_type=userpass
password=mytrunk
username=mytrunk

[6001]
type=aor
max_contacts=10

[6002]
type=endpoint
context=sip_trunk
allow=!all,all
auth=6002
aors=6002

[6002]
type=auth
auth_type=userpass
password=mytrunk
username=mytrunk

[6002]
type=aor
max_contacts=10

server B extensions.conf:

[sip_trunk]
exten => _6XXX,1,Ringing()
same => n,Dial(PJSIP/${EXTEN}@mytrunk,25)
same => n,HangUp()

And the output on server B?

Endpoint registered:

– Added contact ‘sip:s@192.168.42.14:5060’ to AOR ‘mytrunk’ with expiration of 300 seconds
== Endpoint mytrunk is now Reachable

pjsip set logger on results on server B:

*CLI> <— Received SIP request (927 bytes) from UDP:192.168.42.14:5060 —>
INVITE sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10
Contact: sip:asterisk@192.168.42.14:5060
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6663 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Type: application/sdp
Content-Length: 263

v=0
o=- 268483615 268483615 IN IP4 192.168.42.14
s=Asterisk
c=IN IP4 192.168.42.14
t=0 0
m=audio 15042 RTP/AVP 0 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Transmitting SIP response (576 bytes) to UDP:192.168.42.14:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
CSeq: 6663 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1591170583/76a02337d239de4615f7e6b1187ef754”,opaque=“665a8390619f4ab0”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 17.2.0
Content-Length: 0

<— Received SIP request (435 bytes) from UDP:192.168.42.14:5060 —>
ACK sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=z9hG4bKPj31f5d05c-4261-4531-9684-a565fbadd603
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6663 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Length: 0

<— Received SIP request (1228 bytes) from UDP:192.168.42.14:5060 —>
INVITE sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10
Contact: sip:asterisk@192.168.42.14:5060
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6664 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Authorization: Digest username=“mytrunk”, realm=“asterisk”, nonce=“1591170583/76a02337d239de4615f7e6b1187ef754”, uri=“sip:6001@192.168.10.10:5060”, response=“4df20dbc66387cc505f158f59119f693”, algorithm=md5, cnonce=“cebced9492784948aea4c31ecc5b23d8”, opaque=“665a8390619f4ab0”, qop=auth, nc=00000001
Content-Type: application/sdp
Content-Length: 263

v=0
o=- 268483615 268483615 IN IP4 192.168.42.14
s=Asterisk
c=IN IP4 192.168.42.14
t=0 0
m=audio 15042 RTP/AVP 0 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

== Setting global variable ‘SIPDOMAIN’ to ‘192.168.10.10’
<— Transmitting SIP response (374 bytes) to UDP:192.168.42.14:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10
CSeq: 6664 INVITE
Server: Asterisk PBX 17.2.0
Content-Length: 0
– Executing [6001@sip_trunk:1] Ringing(“PJSIP/mytrunk-00000002”, “”) in new stack
– Executing [6001@sip_trunk:2] Dial(“PJSIP/mytrunk-00000002”, “PJSIP/6001@mytrunk,25”) in new stack

<— Transmitting SIP response (562 bytes) to UDP:192.168.42.14:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=50657510-e8d8-493f-8b30-a4fc98fc6aca
CSeq: 6664 INVITE
Server: Asterisk PBX 17.2.0
Contact: sip:192.168.10.10:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Content-Length: 0
– Called PJSIP/6001@mytrunk

<— Transmitting SIP request (900 bytes) to UDP:192.168.42.14:5060 —>
INVITE sip:6001@192.168.42.14:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.10:5060;rport;branch=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
From: “amin” sip:6010@172.17.0.1;tag=fa3de96b-22d8-4ffa-9b4f-1576cb8998f9
To: sip:6001@192.168.42.14
Contact: sip:asterisk@192.168.10.10:5060
Call-ID: 8ef0558d-ac2e-4a0e-bcc3-ffa39609864a
CSeq: 23783 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.2.0
Content-Type: application/sdp
Content-Length: 239

v=0
o=- 1507031352 1507031352 IN IP4 192.168.10.10
s=Asterisk
c=IN IP4 192.168.10.10
t=0 0
m=audio 15400 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<— Received SIP response (572 bytes) from UDP:192.168.42.14:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.10.10:5060;rport=5060;received=192.168.10.10;branch=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
Call-ID: 8ef0558d-ac2e-4a0e-bcc3-ffa39609864a
From: “amin” sip:6010@172.17.0.1;tag=fa3de96b-22d8-4ffa-9b4f-1576cb8998f9
To: sip:6001@192.168.42.14;tag=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
CSeq: 23783 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1591170583/c941a01479250fc6cf06fcd2356eb762”,opaque=“6112531c34747b43”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 17.1.0
Content-Length: 0

<— Transmitting SIP request (433 bytes) to UDP:192.168.42.14:5060 —>
ACK sip:6001@192.168.42.14:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.10:5060;rport;branch=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
From: “amin” sip:6010@172.17.0.1;tag=fa3de96b-22d8-4ffa-9b4f-1576cb8998f9
To: sip:6001@192.168.42.14;tag=z9hG4bKPjf7e9f7bd-d490-496e-b6ec-7a9117e63392
Call-ID: 8ef0558d-ac2e-4a0e-bcc3-ffa39609864a
CSeq: 23783 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 17.2.0
Content-Length: 0

[Jun 3 10:49:43] WARNING[5902]: res_pjsip_outbound_authenticator_digest.c:181 digest_create_request_with_auth: Endpoint: ‘mytrunk’: Unable to create request with auth. No auth credentials for realm(s) ‘asterisk’ in challenge.
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [6001@sip_trunk:3] Hangup(“PJSIP/mytrunk-00000002”, “”) in new stack
== Spawn extension (sip_trunk, 6001, 3) exited non-zero on ‘PJSIP/mytrunk-00000002’
<— Transmitting SIP response (553 bytes) to UDP:192.168.42.14:5060 —>
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;received=192.168.42.14;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=50657510-e8d8-493f-8b30-a4fc98fc6aca
CSeq: 6664 INVITE
Server: Asterisk PBX 17.2.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Reason: Q.850;cause=21
Content-Length: 0

<— Received SIP request (426 bytes) from UDP:192.168.42.14:5060 —>
ACK sip:6001@192.168.10.10:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPjbacc41d2-0218-4172-8804-45787d48e645
From: “amin” sip:6010@192.168.42.14;tag=4c6f80f5-abe7-4d55-a90b-4cb0a55194c4
To: sip:6001@192.168.10.10;tag=50657510-e8d8-493f-8b30-a4fc98fc6aca
Call-ID: 6796b91e-ffec-4b18-b22a-8a748c80e118
CSeq: 6664 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Length: 0

Okay, so you’re calling from server A to server B and then back to server A. Your “identify” section called “mytrunk” on the pjsip.conf for server A is invalid, it should not contain an “auth_username” option.

1 Like

Yes jcolp, i removed auth_username from my pjsip and tested, Now i am getting infinite calls for some reason and the phone is not actually ringing, I think my extensions.conf is causing this problem

[sip_trunk]
exten => _6XXX,1,Ringing()
same => n,Dial(PJSIP/${EXTEN}@mytrunk,25)
same => n,HangUp()

If i remove @mytrunk it works but i cannot call other endpoints from server B
I tried changing it to

Dial(PJSIP/mytrunk/${EXTEN},25)

I get this result:

*CLI> == Setting global variable ‘SIPDOMAIN’ to ‘192.168.42.14’
– Executing [6002@sip_trunk:1] Ringing(“PJSIP/6010-00000006”, “”) in new stack
– Executing [6002@sip_trunk:2] Dial(“PJSIP/6010-00000006”, “PJSIP/mytrunk/6002,25”) in new stack
[Jun 3 04:15:16] ERROR[17640]: res_pjsip.c:3577 ast_sip_create_dialog_uac: Endpoint ‘mytrunk’: Could not create dialog to invalid URI ‘6002’. Is endpoint registered and reachable?
[Jun 3 04:15:16] ERROR[17640]: chan_pjsip.c:2650 request: Failed to create outgoing session to endpoint ‘mytrunk’
[Jun 3 04:15:16] WARNING[17707][C-00000005]: app_dial.c:2578 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [6002@sip_trunk:3] Hangup(“PJSIP/6010-00000006”, “”) in new stack
== Spawn extension (sip_trunk, 6002, 3) exited non-zero on ‘PJSIP/6010-00000006’

server B pjsip show endpoints:

Endpoint: mytrunk Not in use 0 of inf
InAuth: mytrunk/mytrunk
Aor: mytrunk 10
Contact: mytrunk/sip:s@192.168.42.14:5060 ecc98e02e0 NonQual nan
Identify: mytrunk/mytrunk
Match: 192.168.42.14/32

server A pjsip show endpoints:

Endpoint: mytrunk Not in use 0 of inf
OutAuth: mytrunk/mytrunk
Aor: mytrunk 10
Contact: mytrunk/sip:192.168.10.10:5060 55684a016a NonQual nan
Identify: mytrunk/mytrunk
Match: 192.168.10.10/32

Why one of you trunk has inbound auth and the other not ? also why don’t you just use the identify section to authenticate by IP

Hey ambiorixg12,

I added outbound_auth to my other server and it didn’t fix my problem
server B pjsip show endpoints

Endpoint: mytrunk Not in use 0 of inf
OutAuth: mytrunk/mytrunk
Aor: mytrunk 10
Contact: mytrunk/sip:s@192.168.42.14:5060 ecc98e02e0 NonQual nan
Identify: mytrunk/mytrunk
Match: 192.168.42.14/32

I tried searching for identify section to authenticate by IP as you mentioned but i think i have setup everything as mentioned in the documentation:

Home - Asterisk Documentation
Home - Asterisk Documentation

If i use this way for my extensions.conf

[sip_trunk]
exten => _6XXX,1,Ringing()
same => n,Dial(PJSIP/mytrunk/${EXTEN},25)
same => n,HangUp()

I can make calls to endpoints on the same server successfully

*CLI> == Setting global variable ‘SIPDOMAIN’ to ‘192.168.42.14’
– Executing [6003@sip_trunk:1] Ringing(“PJSIP/6010-00001389”, “”) in new stack
– Executing [6003@sip_trunk:2] Dial(“PJSIP/6010-00001389”, “PJSIP/mytrunk/6003,25”) in new stack
– Called PJSIP/mytrunk/6003
– PJSIP/mytrunk-0000138a is ringing
– PJSIP/mytrunk-0000138a is ringing
== Spawn extension (sip_trunk, 6003, 2) exited non-zero on ‘PJSIP/6010-00001389’

, but for endpoints on server B i get this and the call is aborted

== Setting global variable ‘SIPDOMAIN’ to ‘192.168.42.14’
– Executing [6002@sip_trunk:1] Ringing(“PJSIP/6010-0000138b”, “”) in new stack
– Executing [6002@sip_trunk:2] Dial(“PJSIP/6010-0000138b”, “PJSIP/mytrunk/6002,25”) in new stack
[Jun 4 01:11:46] ERROR[29476]: res_pjsip.c:3577 ast_sip_create_dialog_uac: Endpoint ‘mytrunk’: Could not create dialog to invalid URI ‘6002’. Is endpoint registered and reachable?
[Jun 4 01:11:46] ERROR[29476]: chan_pjsip.c:2650 request: Failed to create outgoing session to endpoint ‘mytrunk’
[Jun 4 01:11:46] WARNING[29502][C-000009cc]: app_dial.c:2578 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [6002@sip_trunk:3] Hangup(“PJSIP/6010-0000138b”, “”) in new stack
== Spawn extension (sip_trunk, 6002, 3) exited non-zero on ‘PJSIP/6010-0000138b’

But if i use this logic in my extensions.conf

;[sip_trunk]
;exten => _6XXX,1,Ringing()
; same => n,Dial(PJSIP/${EXTEN}@mytrunk)
; same => n,HangUp()

I am getting infinite calls for endpoints on the same server and endpoints on the other server with no phones ringing

Your problem is the dialplan. Think about what you’ve configured:

On server A when a call is placed to 6002 send the call to server B.
On server B when a call is placed to 6002 send the call to server A.
On server A when a call is placed to 6002 send the call to server B.

You’ve created a loop.

If you want to dial something locally then you use:

same => n,Dial(PJSIP/${EXTEN},25)

So you need to have specific exten entries for those that are local:

exten => _6002,1,Ringing()
same => n,Dial(PJSIP/6002,25)
same => n,HangUp()

As well the format for sending a call to an extension at an endpoint is always PJSIP/${EXTEN}@<endpoint name> so PJSIP/${EXTEN}@mytrunk

Dear jcolp,

Thank you so much for bearing with me and helping me with my issues, I’m very grateful I wouldn’t have got here without your help. I would like to explain my end goal and I hope you can answer me one last time before I close this topic.
My goal is to do sip trunking between 2 asterisk servers, what I mean is that I want to enable all endpoints only configured on server A to have connection to all endpoints only configured in server B and from what i learned through the documentation is that i have to add registration and identify to my pjsip.

endpoints ======> Asterisk server A ======> Asterisk server B ======> endpoints

Now i do not need a dialplan because i have an ARI application that will initiate the call, so eventually my dialplan will be like this:

[sip_trunk]
exten => _6XXX,1,NoOp()
same => n,Stasis(Intro-IVR)
same => n,HangUp()

I have my ARI application running on asterisk server A and i want to initiate a call to an endpoint configured on asterisk server B. When i try to do that kindly look at the result

[Jun 4 03:27:14] ERROR[32137]: chan_pjsip.c:2621 request: Unable to create PJSIP channel - endpoint ‘6002’ was not found

But when i try it on an endpoint on asterisk server A it is working and here is the result

*CLI> <— Transmitting SIP request (627 bytes) to UDP:10.0.10.246:5062 —>
INVITE sip:6003@10.0.10.246:5062 SIP/2.0
Via: SIP/2.0/UDP 192.168.42.14:5060;rport;branch=z9hG4bKPjdb4d38cd-339a-42f5-bce0-9f0d5e936f41
From: sip:96170826342@192.168.42.14;tag=8533fa29-64fb-4b0e-ada5-764211d41157
To: sip:6003@10.0.10.246
Contact: sip:asterisk@192.168.42.14:5060
Call-ID: da478b07-6dfc-41c4-9012-7f0c99707e92
CSeq: 10893 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 17.1.0
Content-Length: 0

-- Called 6003

<— Received SIP response (487 bytes) from UDP:10.0.10.246:5062 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;branch=z9hG4bKPjdb4d38cd-339a-42f5-bce0-9f0d5e936f41
From: sip:96170826342@192.168.42.14;tag=8533fa29-64fb-4b0e-ada5-764211d41157
To: sip:6003@10.0.10.246
Call-ID: da478b07-6dfc-41c4-9012-7f0c99707e92
CSeq: 10893 INVITE
Supported: replaces, path, timer
User-Agent: Grandstream GXP1625 1.0.4.152
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0

<— Received SIP response (566 bytes) from UDP:10.0.10.246:5062 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.42.14:5060;rport=5060;branch=z9hG4bKPjdb4d38cd-339a-42f5-bce0-9f0d5e936f41
From: sip:96170826342@192.168.42.14;tag=8533fa29-64fb-4b0e-ada5-764211d41157
To: sip:6003@10.0.10.246;tag=328021589
Call-ID: da478b07-6dfc-41c4-9012-7f0c99707e92
CSeq: 10893 INVITE
Contact: sip:6003@10.0.10.246:5062
Supported: replaces, path, timer
User-Agent: Grandstream GXP1625 1.0.4.152
Allow-Events: talk, hold
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0

-- PJSIP/6003-00001641 is ringing
-- PJSIP/6003-00001641 is ringing

Your two Asterisk instances are already connected. That’s not a problem. Your problem is your routing. You really need to step back and think through stuff. If a call is placed to server B but the device is actually connected to server A, then server B has to know that and send the call to server A which then calls the device. You have to configure that somehow or know. That’s the core of your problem, and while I’ve given examples it’s up to you to take that, think through your setup, and determine how to make it work for you.

Sorry I did not elaborate my scenario enough, I do have an endpoint setup on a device ( IP phone) that is connected to server B and I am using my stasis application that has a websocket connection to server A, so I want to use my application to call the device connected to server B. Okay if my two asterisk instances are connected I think I will have to work on my application.

If your ARI application is connected to server A, then you have to tell it to call the extension on server B.

1 Like

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