<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>
&gt;&nbsp; After 3 hours stuck on this I have to ask the group. I am setting up<br>
&gt; Kam 3.1.3 +Ast 1.6.2.18 + realtime following Daniel&#8217;s guide on the<br>
&gt; Asipto site. The problem I see is 401 not authorized when uac tries to<br>
&gt; 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&#8230;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 &#8230; 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&#8217;ve followed
the guide 100% you are undoubtedly looking for the &#8220;trick&#8221; to &#8220;configure
Asterisk to not authenticate SIP requests coming from Kamailio&#8221;. Well, there&#8217;s
no trick. Just slow down and read again. If that doesn&#8217;t work &#8230; 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=&lt;blank&gt; and permit=&lt;kamailioip&gt;
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 =&lt; kamailioip
&gt; Asterisk will ONLY accept registration from Kamailio for the extension. You
may want to set permit =&lt; kamailioip &gt; 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 &#8216;say it out loud&#8217;
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'>&nbsp;<o:p></o:p></span></p>

<p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;<o:p></o:p></span></p>

</div>

</body>

</html>