[Asterisk-Users] SIP auth failed "wrong pw" but pw is correct

Mark Drayton mdrayton at fsys.co.uk
Mon Jun 12 06:59:34 MST 2006


Hi

We've got an Asterisk 1.2.0 (planning to upgrade when I can) which is 
having trouble registering another Asterisk system as a client. We have 
the client in a realtime DB, our client has us configured as a friend and 
also has a register => username:password at our.host/username line in his 
sip.conf.

When he starts his system he gets an auth failed log line and we get:

Jun 12 14:42:21 NOTICE[1548]: chan_sip.c:10817 handle_request_register: 
Registration from '<sip:user at fqdn.our.host>' failed for '81.187.x.x' - 
Wrong password

The client has the right username and password.

One difference I've noticed is that the log error says "Registration from 
'<sip:user at fqdn.our.host>' failed for '81.187.x.x'" -- every other 
registration line quotes only the SIP account name, not the whole SIP URI.

This problem does look similar to bug #5103 but the fix should be 
incorporated in Asterisk 1.2.0, I think.

SIP trace:

Sending to 81.187.x.x : 5060 (non-NAT)
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK26bc6cc8;received=81.187.x.x;rport=5060
From: <sip:username at fdqn.our.host>;tag=as48322a50
To: <sip:username at fdqn.our.host>
Call-ID: 6b6b0c51122cc44729ad525b47928c0e at 81.187.x.x
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: <sip:username at 146.101.our.ip>
Content-Length: 0


---
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK26bc6cc8;received=81.187.x.x;rport=5060
From: <sip:username at fdqn.our.host>;tag=as48322a50
To: <sip:username at fdqn.our.host>;tag=as7592c16c
Call-ID: 6b6b0c51122cc44729ad525b47928c0e at 81.187.x.x
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: <sip:username at 146.101.our.ip>
WWW-Authenticate: Digest realm="asterisk", nonce="63563ef1"
Content-Length: 0


---
Scheduling destruction of call 
'6b6b0c51122cc44729ad525b47928c0e at 81.187.x.x' in 15000 ms
sip2*CLI>
<-- SIP read from 81.187.x.x:5060:
REGISTER sip:fdqn.our.host SIP/2.0
Via: SIP/2.0/UDP 81.187.x.x:5060;branch=z9hG4bK06e5ad1f;rport
From: <sip:username at fdqn.our.host>;tag=as3c9883b7
To: <sip:username at fdqn.our.host>
Call-ID: 6b6b0c51122cc44729ad525b47928c0e at 81.187.x.x
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username="username", realm="asterisk", 
algorithm=MD5, uri="sip:fdqn.our.host", nonce="63563ef1", 
response="d6daaafb77c11357bda9b912b8ce6e02", opaque=""
Expires: 18000
Contact: <sip:username at 81.187.x.x>
Event: registration
Content-Length: 0


--- (13 headers 0 lines)---
Using latest REGISTER request as basis request
Sending to 81.187.x.x : 5060 (NAT)
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK06e5ad1f;received=81.187.x.x;rport=5060
From: <sip:username at fdqn.our.host>;tag=as3c9883b7
To: <sip:username at fdqn.our.host>
Call-ID: 6b6b0c51122cc44729ad525b47928c0e at 81.187.x.x
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: <sip:username at 146.101.our.ip>
Content-Length: 0


---
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 403 Forbidden (Bad auth)
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK06e5ad1f;received=81.187.x.x;rport=5060
From: <sip:username at fdqn.our.host>;tag=as3c9883b7
To: <sip:username at fdqn.our.host>;tag=as7592c16c
Call-ID: 6b6b0c51122cc44729ad525b47928c0e at 81.187.x.x
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: <sip:username at 146.101.our.ip>
Content-Length: 0

Any ideas?

Cheers,

Mark

This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure.  If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment(s) from your system and do not disclose its contents to any
third parties.



More information about the asterisk-users mailing list