<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<title>Re: [SR-Users] Kamailio + Asterisk 1.6.2 Realtime - REGFWD : 401 not
authorized</title>
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.avgcert, li.avgcert, div.avgcert
        {mso-style-name:avgcert;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p><span style='font-size:10.0pt'>Skyler wrote:<br>
> After 3 hours stuck on this I have to ask the group. I am setting up<br>
> Kam 3.1.3 +Ast 1.6.2.18 + realtime following Daniel’s guide on the<br>
> Asipto site. The problem I see is 401 not authorized when uac tries to<br>
> register.<br>
<br>
Hey, kamailio is addictive - there are quite some of us doing it on<br>
Sundays ;-)<br>
<br>
I've just checked the manual, it says kamailio, not asterisk should do<br>
authentication of REGISTERs. Could you check you have created sipusers<br>
table and configured asterisk as per manual:<br>
<br>
sipusers is the standard table required by Asterisk to store SIP user<br>
profile, with one extra column sippasswd where will be stored the<br>
password for SIP authentication. By default, Asterisk uses the column<br>
secret for SIP user password, but if that is filled in, Asterisk will<br>
ask for authentication again, resulting in double-authentication which<br>
we want to avoid.<br>
?<br>
<br>
--<br>
Sincerely,<br>
Andrew Pogrebennyk<br>
<br>
<span style='color:#1F497D'>---------------------------------------------------------------------</span><o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>OMG…right
under my nose the whole time. I love this stuff! ;)<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I
must have read and re-read the asipto guide a thousand times and googled until
my fingers seized up, but I completely missed that … lol<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>So,
in case anyone else comes across this same problem and you’ve followed
the guide 100% you are undoubtedly looking for the “trick” to “configure
Asterisk to not authenticate SIP requests coming from Kamailio”. Well, there’s
no trick. Just slow down and read again. If that doesn’t work … do
this:<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>For
each Asterisk extension - set host=dynamic, secret=<blank> and permit=<kamailioip>
then put the device password into sippasswd field in db. Kamailio will
authenticate the device with sippasswd in db and route[REGFWD] will pass the
registration to Asterisk. Since there is no password for secret, Asterisk will
register the extension to kamailio.ip:port automatically. Because permit =< kamailioip
> Asterisk will ONLY accept registration from Kamailio for the extension. You
may want to set permit =< kamailioip > in sip.conf general section to set
ACL for all extensions to make life easier.<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>My
particular problem was that I did not delete the secret. This apparently causes
Asterisk to request authentication from Kamailio on registration FWD.<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks
Andrew, sometimes it just takes another person to ‘say it out loud’
lol<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Skyler
<o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> <o:p></o:p></span></p>
<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> <o:p></o:p></span></p>
</div>
</body>
</html>