Trunk with auth between 2 Asterisks PJSIP

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Trunk with auth between 2 Asterisks PJSIP

Postby arcticfox » Sun Dec 20, 2015 9:26 am

Hello,
please check that configuration and debug:

Code: Select all
AsteriskA (dns:asterisk1.sample.net):
[trunk_defaults](!)
type = wizard
endpoint/language = ru
endpoint/allow = !all,ulaw,alaw
aor/qualify_frequency = 30
registration/expiration = 300
[asteriskOP](trunk_defaults)
transport = internal-ipv4-udp
sends_auth = yes
sends_registrations = yes
accepts_registrations = no
accepts_auth = no
outbound_auth/username = asterisk
outbound_auth/password = 1232123
remote_hosts = asterisk2.sample.net
endpoint/context = asteriskop
endpoint/send_rpid = yes
endpoint/send_pai = yes
registration/support_path = no


AsteriskB (dns:asterisk2.sample.net):
[trunk_defaults](!)
type = wizard
endpoint/language = ru
endpoint/allow_subscribe = no
endpoint/allow = !all,ulaw,alaw
aor/qualify_frequency = 30
registration/expiration = 300
[Asterisk](trunk_defaults)
transport = net0-ipv4-udp
remote_hosts = asterisk1.sample.net
sends_auth = no
sends_registrations = no
accepts_auth = yes
accepts_registrations = yes
inbound_auth/username = asterisk
inbound_auth/password = 1232123
inbound_auth/auth_type = userpass
endpoint/context = asterisk
endpoint/send_rpid = yes
endpoint/send_pai = yes

Asterisk 1 side Error:
WARNING[7931]: res_pjsip_outbound_registration.c:616 handle_registration_response: Fatal response '401' received from 'sip:asterisk2.sample.net' on registration attempt to 'sip:asterisk@asterisk2.sample.net', stopping outbound registration
Asterisk 2 side logger:
<--- Received SIP request (479 bytes) from UDP:192.168.0.4:5060 --->
OPTIONS sip:asterisk2.sample.net SIP/2.0
Via: SIP/2.0/UDP 192.168.0.4:5060;rport;branch=z9hG4bKPj98c60211-ff22-46b9-b5b6- c0348fd210dc
From: <sip:174b3ac7-5840-4cf1-9598-05b1b79129b7@192.168.0.4>;tag=167989f3-e476-4 0ae-99d4-461c54b83f36
To: <sip:asterisk2.sample.net>
Contact: <sip:174b3ac7-5840-4cf1-9598-05b1b79129b7@192.168.0.4:5060>
Call-ID: c80a203a-e437-496e-817f-98bd74fe85f0
CSeq: 9494 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 13.3.2
Content-Length: 0

<--- Received SIP request (561 bytes) from UDP:192.168.0.4:5060 --->
REGISTER sip:asteriskop.sample.net SIP/2.0
Via: SIP/2.0/UDP 192.168.0.4:5060;rport;branch=z9hG4bKPjae62850c-6b90-41f3-a861- eca69b0f0e67
From: <sip:asterisk@asterisk2.sample.net>;tag=0421d1e6-df8c-408c-818b-6a17fd55d0c 3
To: <sip:asterisk@asterisk2.sample.net>
Call-ID: 48d57196-7343-4055-81fa-a0324f489ddd
CSeq: 38140 REGISTER
Contact: <sip:s@192.168.0.4:5060>
Expires: 300
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PR ACK, REFER, MESSAGE, REGISTER
Max-Forwards: 70
User-Agent: Asterisk PBX 13.3.2
Content-Length: 0

<--- Transmitting SIP response (586 bytes) to UDP:192.168.0.4:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.0.4:5060;rport=5060;received=192.168.0.4;branch=z9hG4bK Pjae62850c-6b90-41f3-a861-eca69b0f0e67
Call-ID: 48d57196-7343-4055-81fa-a0324f489ddd
From: <sip:asterisk@asterisk2.sample.net>;tag=0421d1e6-df8c-408c-818b-6a17fd55d0c 3
To: <sip:asterisk@asterisk2.sample.net>;tag=z9hG4bKPjae62850c-6b90-41f3-a861-eca6 9b0f0e67
CSeq: 38140 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1450394658/a0b9b33f55c72aff087 6785f21273b43",opaque="289a810e5781b22c",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.6.0
Content-Length: 0

<--- Transmitting SIP response (586 bytes) to UDP:192.168.0.4:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.0.4:5060;rport=5060;received=192.168.0.4;branch=z9hG4bK Pjd73ee871-89e4-470a-9137-a9d3b77cc6bc
Call-ID: 48d57196-7343-4055-81fa-a0324f489ddd
From: <sip:asterisk@asterisk2.sample.net>;tag=0421d1e6-df8c-408c-818b-6a17fd55d0c 3
To: <sip:asterisk@asterisk2.sample.net>;tag=z9hG4bKPjd73ee871-89e4-470a-9137-a9d3 b77cc6bc
CSeq: 38141 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1450394658/a0b9b33f55c72aff087 6785f21273b43",opaque="0d2823481e92481a",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.6.0
Content-Length: 0
arcticfox
Newsterisk
 
Posts: 1
Joined: Sun Dec 20, 2015 9:20 am

Return to Asterisk Support

Who is online

Users browsing this forum: MSN [Bot] and 1 guest