Leandro Dardini
2011-Jul-29 09:56 UTC
[asterisk-users] Asterisk SIP authentication against [section] instead of username
Hello, Asterisk seems to try to authenticate incoming INVITE based on the [section] in sip.conf and not the username specified. I just removed the "insecure" option from my sip.conf requesting every connection to be authenticated. I added the match_auth_username=yes in the [general] section for extra security. To make it work, I have to use the same [section] identifier as username. This is really bad because if multiple provider are giving me the same username, it doesn't work. If I put the following data in sip.conf, it doesn't work. Asterisk return the following error: [2011-07-29 04:55:30] WARNING[9971]: chan_sip.c:13205 check_auth: username mismatch, have <GoodProvider>, digest has <myusername> [GoodProvider] username=myusername auth=myusername defaultuser=myusername secret=verydifficultpass type=friend host=pbx.goodprovider.com canreinvite=No dtmfmode=rfc2833 context=from-outside accountcode=GoodProvider disallow=all allow=ulaw If I put the following data in sip.conf, it does work: [myusername] username=myusername auth=myusername defaultuser=myusername secret=verydifficultpass type=friend host=pbx.goodprovider.com canreinvite=No dtmfmode=rfc2833 context=from-outside accountcode=GoodProvider disallow=all allow=ulaw I check the INVITE from the "GoodProvider" and it is sending "myusername" Am I doing something wrong or is really asterisk checking the wrong section? Leandro -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110729/3648ea06/attachment.htm>