[asterisk-dev] Order of authentication checks in chan_sip.c

John Lange j.lange at epic.ca
Thu Aug 17 10:51:09 MST 2006


On Thu, 2006-08-17 at 09:12 -0500, Kevin P. Fleming wrote:
> ----- Dinesh Nair <dinesh at alphaque.com> wrote:
> > referring to the existing setup (all asterisk 1.2.10 on FreeBSD 6.1),
> > 
> > SIP Exten 1234 <---> AsteriskA <--- SIP ---> AsteriskB <---> SIP Exten
> > 1234
> > 
> > AsteriskA and AsteriskB are interconnected using SIP, with AsteriskB 
> > registering to AsteriskA.
> > 
> > now, the problem happens when sip.conf on both Asterisks have an entry
> > for 
> > 1234 (as above), since they both have a SIP hardphone attached to
> > them.
> 
> As Olle already responded... It is not recommended to use extension numbers or CLID numbers as SIP peer names (and in fact it can't be done when an Asterisk server is being used to host multiple PBXes with similar extension numbers).
> 
> On my own systems, I construct the SIP peer names for hardphones using a portion of the phone's MAC address to avoid this exact issue.

I've debated using MAC addresses as usernames but ruled it out because
it doesn't allow for simple dial plans since you end up needing a Dial
rule for every user. So for example you could not do:

exten => _X.,1,Dial(SIP/${EXTEN})

The solution is to append something to the end of your extension and use
it as the username, for example an "x". Then you can do as follows:

exten => _X.,1,Dial(SIP/${EXTEN}x)

Your username in sip.conf would be [2041239876x]

You maintain a much more efficient dial plan while avoiding the issue of
usernames matching CLID numbers.

Regards,

John





More information about the asterisk-dev mailing list