[asterisk-bugs] [Asterisk 0009678]: check_auth fails with 'username mismatch' when using multiple registrations to same host

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Oct 5 09:52:34 CDT 2010


The issue 0018082 has been set as DUPLICATE OF the following issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=9678 
====================================================================== 
Reported By:                cstadlmann
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   9678
Category:                   Core/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.4 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Request Review:              
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             2007-05-07 11:08 CDT
Last Modified:              2010-10-05 09:52 CDT
====================================================================== 
Summary:                    check_auth fails with 'username mismatch' when using
multiple registrations to same host
Description: 
I have multiple accounts with my provider with different username and
resulting phone number.

sip.conf:
[general]
register=v205722aa:xxxxx:v205722aa at voip.mywave.at/v205722aa
register=v205722ab:xxxxx:v205722ab at voip.mywave.at/v205722ab
register=v205722ac:xxxxx:v205722ac at voip.mywave.at/v205722ac

[v205722aa]
username=v205722aa
fromuser=v205722aa
authname=v205722aa
type=peer
secret=xxxxx
qualify=yes
nat=yes
language=de
;insecure=port,invite
host=voip.mywave.at
disallow=all
allow=ulaw
context=trunk-v205722aa
canreinvite=no

[v205722ab]
username=v205722ab
fromuser=v205722ab
authname=v205722ab
type=peer
secret=xxxxx
qualify=yes
nat=yes
language=de
;insecure=port,invite
host=voip.mywave.at
disallow=all
allow=ulaw
context=trunk-v205722ab
canreinvite=no

[v205722ac]
username=v205722ac
fromuser=v205722ac
authname=v205722ac
type=peer
secret=xxxxx
qualify=yes
nat=yes
language=de
;insecure=port,invite
host=voip.mywave.at
disallow=all
allow=ulaw
context=trunk-v205722ac
canreinvite=no


Outgoing Calls no problem, but incoming calls only with first account. If
I get a call to the second peer, the following happens:

<--- SIP read from 85.193.128.15:5060 --->
INVITE sip:83.65.56.171 SIP/2.0
Via: SIP/2.0/UDP 85.193.128.15:5060;branch=z9hG4bK606e012c;rport
From: "0720440931017" <sip:0720440931017 at 85.193.128.15>;tag=as2dc901b6
To: <sip:83.65.56.171>
Contact: <sip:0720440931017 at 85.193.128.15>
Call-ID: 7bb0b84371131e974ea374eb7c489fae at 85.193.128.15
CSeq: 103 INVITE
User-Agent: mywave VoIP Gateway
Max-Forwards: 70
Proxy-Authorization: Digest username="v205722ab", realm="asterisk",
algorithm=MD5, uri="sip:83.65.56.171", nonce="58d62e22",
response="de5d30a54b2d4c3695b5959b14c0acbc", opaque=""
Date: Mon, 07 May 2007 14:49:00 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 242

v=0
o=root 13547 13548 IN IP4 85.193.128.15
s=session
c=IN IP4 85.193.128.15
t=0 0
m=audio 10346 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
<------------->
--- (15 headers 12 lines) ---
Sending to 85.193.128.15 : 5060 (NAT)
Using INVITE request as basis request -
7bb0b84371131e974ea374eb7c489fae at 85.193.128.15
Found peer 'v205722aa'
[May  7 16:49:01] WARNING[21698]: chan_sip.c:8126 check_auth: username
mismatch, have <v205722aa>, digest has <v205722ab>
[May  7 16:49:01] NOTICE[21698]: chan_sip.c:13379 handle_request_invite:
Failed to authenticate user "0720440931017"
<sip:0720440931017 at 85.193.128.15>;tag=as2dc901b6
asteriskdev*CLI>
<--- Reliably Transmitting (NAT) to 85.193.128.15:5060 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP
85.193.128.15:5060;branch=z9hG4bK606e012c;received=85.193.128.15;rport=5060
From: "0720440931017" <sip:0720440931017 at 85.193.128.15>;tag=as2dc901b6
To: <sip:83.65.56.171>;tag=as2691c9e1
Call-ID: 7bb0b84371131e974ea374eb7c489fae at 85.193.128.15
CSeq: 103 INVITE
User-Agent: VoiceOne
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0


As you can see, Asterisk always tries to match against first matching
peer.

Also, because this is a DID account, invites always come in in the form:
To: <sip:83.65.56.171>
To: <sip:444 at 83.65.56.171>

I tried everything to get this running, nothing helped.
So please assist in configuring multiple registrations to the same host,
maybe it's a bug in the authentication procedure in chan_sip.c.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0018082 can't register to different sip account...
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-10-05 09:52 lmadsen        Relationship added       has duplicate 0018082
======================================================================




More information about the asterisk-bugs mailing list