Summary:ASTERISK-17894: Asterisk to Asterisk multiple registration goes to "username mismatch"
Reporter:Zoltan Kovacs (kovzol)Labels:
Date Opened:2011-05-19 15:14:04Date Closed:2011-06-07 14:05:18
Versions: Frequency of
Description:I run two Asterisk servers, "A" as a general VoIP proxy, and "B" as a smaller PBX.

Server "A" is configured to serve many different types of SIP clients, including Asterisk clients as well. Server "B" is also a client for server "A". On server "B" I use multiple SIP registrations with the following type of SIP registry:

register => reg1:pass1@serverA.ip/reg1
register => reg2:pass2@serverA.ip/reg2
register => reg3:pass3@serverA.ip/reg3

On server "A" I have the following configuration for each registration:


Similar configurations are defined for reg2 and reg3, too.

On server "B" I use the following piece of code for extensions.conf to make a difference among the incoming calls for the different registrations:

exten => _X.,1,Set(INCOMING_LINE=${EXTEN})
exten => ...

As far as I know, this is the official way to handle what I'd like to. This works properly in most cases, but sometimes I experience that the registrations go wrong. Every time it happens I get this "well known" error message:

[May 19 20:44:46] WARNING[24776] chan_sip.c: username mismatch, have <reg2>, digest has <reg3>
[May 19 20:44:46] NOTICE[24776] chan_sip.c: Failed to authenticate device "+XXXXXXXXXX" <sip:+XXXXXXXXXX@serverA.ip>;tag=as6e4a4ef9

All the time I get this error message, if I enter a "sip reload" on the CLI on server "B", the registrations work properly again.


As far as I can see, this happens when I do an inbound call from the +XXXXXXXXXX phone. Server "B" thinks that he has to authenticate this phone as one of his accounts, but of course, this should not be the case.

Server "B" is version

Server "A" is version 1.4.36.

Sometimes the +XXXXXXXXXX phone is working properly without any problems. Sometimes not. Until I am not restarting server "B", I always get the error message, and all of my inbound calls are dropped by server "B" (independently of the caller phone). After I enter a "sip reload" on server "B", the registrations are OK for some time (usually several hours, but sometimes only for just a few minutes), and the inbound calls are also working properly.
Comments:By: Leif Madsen (lmadsen) 2011-05-23 09:58:18

This is a configuration issue. Please use the #asterisk-users list for support with configuration issue. (Tip: you need to look at fromuser)