[asterisk-users] PBXNSIP Registration Issue

Peder peder at networkoblivion.com
Wed Sep 30 12:34:28 CDT 2009


I've got PBXNSIP running on a windows box and it is trying to register with
my Asterisk box.  I can set up one trunk and it works fine, however if I try
to setup a second trunk from the same box, there is some sort of
authentication issue where Asterisk appears to be confusing which trunk is
which.  Here is the chunk from my sip.conf:

[TEST1]
context=STUFF-LD
type=friend
callerid="TEST1" <>
username=TEST1
secret=xxxx
host=dynamic
nat=yes
canreinvite=no
qualify=yes

[TEST2]
context=STUFF-LD
type=friend
callerid="TEST2" <>
username=TEST2
secret=xxxx
host=dynamic
nat=yes
canreinvite=no
qualify=yes

'sip show peers' shows both registered on Asterisk ok.  If I try and call
out test2, it works.  However, if I try and call out test1, it fails with
this:

[Sep 30 12:01:10] WARNING[16678]: chan_sip.c:8272 check_auth: username
mismatch,
 have <TEST2>, digest has <TEST1>

[Sep 30 12:01:10] NOTICE[16678]: chan_sip.c:13587 handle_request_invite:
Failed
 to authenticate user "3210" <sip:3210 at 192.168.100.72;user=phone>;
tag=9055

What is happening is that since both regs come from the same remote IP,
Asterisk thinks the call is coming from test2, even though it is really
coming from test1 per the sip debug below.  Any idea how to make Asterisk
realize that the call is on test1?

<--- SIP read from 192.168.100.98:5060 --->
INVITE sip:6463 at 192.168.100.72;user=phone SIP/2.0
Via: SIP/2.0/UDP
192.168.100.98:5060;branch=z9hG4bK-b6ab2347b7aeeed06dbb606b08ea8b68;rport
From: "3210" <sip:3210 at 192.168.100.72;user=phone>;tag=63019
To: <sip:6463 at 192.168.100.72;user=phone>
Call-ID: 26f9193e at pbx
CSeq: 23974 INVITE
Max-Forwards: 70
Contact: <sip:TEST1 at 192.168.100.98:5060;transport=udp>
Supported: 100rel, replaces, norefersub
Allow-Events: refer
Allow: INVITE, ACK, CANCEL, BYE, REFER, PRACK, INFO, UPDATE
Accept: application/sdp
User-Agent: pbxnsip-PBX/3.4.0.3201
P-Asserted-Identity: "TEST1" <sip:TEST1 at 192.168.100.72>
Content-Type: application/sdp
Content-Length: 196

v=0
o=- 30939 30939 IN IP4 192.168.100.98
s=-
c=IN IP4 192.168.100.98
t=0 0
m=audio 63088 RTP/AVP 0 101
a=rtpmap:0 pcmu/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv

<------------->
--- (16 headers 10 lines) ---
Sending to 192.168.100.98 : 5060 (NAT)
Using INVITE request as basis request - 26f9193e at pbx
Found peer 'TEST2'

<--- Reliably Transmitting (NAT) to 192.168.100.98:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP
192.168.100.98:5060;branch=z9hG4bK-b6ab2347b7aeeed06dbb606b08ea8b68;received
=192.168.100.98;rport=5060
From: "3210" <sip:3210 at 192.168.100.72;user=phone>;tag=63019
To: <sip:6463 at 192.168.100.72;user=phone>;tag=as6350df4b
Call-ID: 26f9193e at pbx
CSeq: 23974 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="7edf0cb1"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '26f9193e at pbx' in 1344 ms (Method:
INVITE)
Retransmitting #1 (NAT) to 192.168.100.98:5060:
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP
192.168.100.98:5060;branch=z9hG4bK-b6ab2347b7aeeed06dbb606b08ea8b68;received
=192.168.100.98;rport=5060
From: "3210" <sip:3210 at 192.168.100.72;user=phone>;tag=63019
To: <sip:6463 at 192.168.100.72;user=phone>;tag=as6350df4b
Call-ID: 26f9193e at pbx
CSeq: 23974 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="7edf0cb1"
Content-Length: 0


---
dell860*CLI>
<--- SIP read from 192.168.100.98:5060 --->
ACK sip:6463 at 192.168.100.72;user=phone SIP/2.0
Via: SIP/2.0/UDP
192.168.100.98:5060;branch=z9hG4bK-b6ab2347b7aeeed06dbb606b08ea8b68;rport
From: "3210" <sip:3210 at 192.168.100.72;user=phone>;tag=63019
To: <sip:6463 at 192.168.100.72;user=phone>;tag=as6350df4b
Call-ID: 26f9193e at pbx
CSeq: 23974 ACK
Max-Forwards: 70
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
dell860*CLI>
<--- SIP read from 192.168.100.98:5060 --->
INVITE sip:6463 at 192.168.100.72;user=phone SIP/2.0
Via: SIP/2.0/UDP
192.168.100.98:5060;branch=z9hG4bK-757d8077f9a2b9108ec158f2fc07d30a;rport
From: "3210" <sip:3210 at 192.168.100.72;user=phone>;tag=63019
To: <sip:6463 at 192.168.100.72;user=phone>
Call-ID: 26f9193e at pbx
CSeq: 23975 INVITE
Max-Forwards: 70
Contact: <sip:TEST1 at 192.168.100.98:5060;transport=udp>
Supported: 100rel, replaces, norefersub
Allow-Events: refer
Allow: INVITE, ACK, CANCEL, BYE, REFER, PRACK, INFO, UPDATE
Accept: application/sdp
User-Agent: pbxnsip-PBX/3.4.0.3201
P-Asserted-Identity: "TEST1" <sip:TEST1 at 192.168.100.72>
Proxy-Authorization: Digest
realm="asterisk",nonce="7edf0cb1",response="5ececd40c28f0378503e2dd6ee5cef14
",username="TEST1",uri="sip:6463 at 192.168.100.72;user=phone",algorithm=MD5
Content-Type: application/sdp
Content-Length: 196

v=0
o=- 30939 30939 IN IP4 192.168.100.98
s=-
c=IN IP4 192.168.100.98
t=0 0
m=audio 63088 RTP/AVP 0 101
a=rtpmap:0 pcmu/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv

<------------->
--- (17 headers 10 lines) ---
Sending to 192.168.100.98 : 5060 (NAT)
Using INVITE request as basis request - 26f9193e at pbx
Found peer 'TEST2'
[Sep 30 12:11:16] WARNING[16678]: chan_sip.c:8272 check_auth: username
mismatch, have <TEST2>, digest has <TEST1>
[Sep 30 12:11:16] NOTICE[16678]: chan_sip.c:13587 handle_request_invite:
Failed to authenticate user "3210"
<sip:3210 at 192.168.100.72;user=phone>;tag=63019




More information about the asterisk-users mailing list