<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    run Kamailio with higher debug value (debug=4) and watch the syslog,
    you should get some hints about authentication failure - can be
    wrong password, invalid nonce, etc<br>
    <br>
    Also, you should consider using 3.0 directly if you just start the
    configuration. It has lot of improvements and next major release 3.1
    is approaching, upgrade from 3.0 is far easier than from 1.5.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    On 8/18/10 12:37 AM, Toyima Dias wrote:
    <blockquote
      cite="mid:AANLkTinF0vFE1=T3HG_50YuRyt8dftkQ4QwjRFX-2VS1@mail.gmail.com"
      type="cite">HEllo community,
      <div><br>
      </div>
      <div>I'm having some problems with my kamailio configuration,
        following is the section of my authentication process on my
        /etc/kamailio/kamailio.cfg</div>
      <div><br>
      </div>
      <div>
        <div>route [3] {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (is_method("REGISTER")) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!www_authorize("", "subscriber")) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; www_challenge("", "0");</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
        <div><br>
        </div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($au!=$tU) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403", "Forbidden
          auth ID");</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (from_uri==myself) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(!proxy_authorize("",
          "subscriber")) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          proxy_challenge("", "0");</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
        <div><br>
        </div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (is_method("PUBLISH")) &nbsp;{</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($au!=$tU) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403",
          "Forbidden auth ID");</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($au!=$fU) {</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_send_reply("403",
          "Forbidden auth ID");</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; consume_credentials();</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }</div>
        <div>
          &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; return;</div>
        <div>}</div>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>I added a user with the following command:</div>
      <div><br>
      </div>
      <div>
        <div># kamctl add 1102 123456</div>
      </div>
      <div><br>
      </div>
      <div>And then i checked on mysql, table subscriber:</div>
      <div><br>
      </div>
      <div>
        <div>mysql&gt; select * from subscriber;</div>
        <div>+----+----------+---------------+----------+---------------+----------------------------------+----------------------------------+------+</div>
        <div>| id | username | domain &nbsp; &nbsp; &nbsp; &nbsp;| password | email_address
          | ha1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| ha1b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; | rpid |</div>
        <div>+----+----------+---------------+----------+---------------+----------------------------------+----------------------------------+------+</div>
        <div>| &nbsp;3 | 1102 &nbsp; &nbsp; | <a moz-do-not-send="true"
            href="http://dannydias.com">dannydias.com</a> | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | fe7a80817383cfd90950dea03d37eccf |
          dbb9b6ef93d4f3417038a6bf5cd176db | NULL |&nbsp;</div>
        <div>+----+----------+---------------+----------+---------------+----------------------------------+----------------------------------+------+</div>
        <div>1 row in set (0.00 sec)</div>
        <div><br>
        </div>
      </div>
      <div>By the way, the domain field does not exist (<a
          moz-do-not-send="true" href="http://dannydias.com">dannydias.com</a>)
        i'm not sure how this could affect the authentication process,
        this migh be the problem?</div>
      <div><br>
      </div>
      <div>And finally, ngrep-sip to check what is going on:</div>
      <div><br>
      </div>
      <div>
        <div>#</div>
        <div>U 2010/08/17 22:28:38.548357 <a moz-do-not-send="true"
            href="http://80.26.81.96:26932">80.26.81.96:26932</a> -&gt;
          <a moz-do-not-send="true" href="http://212.230.19.191:5060">212.230.19.191:5060</a></div>
        <div><b><u>REGISTER <a class="moz-txt-link-freetext" href="sip:212.230.19.191">sip:212.230.19.191</a> SIP/2.0'</u></b></div>
        <div>Via: SIP/2.0/UDP 80.26.81.96:26932;branch=z9hG4bK-d2ee4e38'</div>
        <div>From: "1102" &lt;<a moz-do-not-send="true"
            href="mailto:sip%3A1102@212.230.19.191">sip:1102@212.230.19.191</a>&gt;;tag=36dcc698cfc16210o1'</div>
        <div>To: "1102" &lt;<a moz-do-not-send="true"
            href="mailto:sip%3A1102@212.230.19.191">sip:1102@212.230.19.191</a>&gt;'</div>
        <div>Call-ID: <a moz-do-not-send="true"
            href="mailto:4aab2f50-775b4d34@80.26.81.96">4aab2f50-775b4d34@80.26.81.96</a>'</div>
        <div>
          CSeq: 10409 REGISTER'</div>
        <div>Max-Forwards: 70'</div>
        <div>Authorization: Digest
username="1102",realm="212.230.19.191",nonce="4c6b0d34000000c9c4e2068de2d41bec38c6d23029696501",uri=<a class="moz-txt-link-rfc2396E" href="sip:212.230.19.191">"sip:212.230.19.191"</a>,algorithm=MD5,response="a09ea335a01051d714d2cbfe95e17820"'</div>
        <div>Contact: "1102" &lt;<a moz-do-not-send="true"
            href="http://sip:1102@80.26.81.96:26932">sip:1102@80.26.81.96:26932</a>&gt;;expires=180'</div>
        <div>User-Agent: Linksys/SPA942-5.1.15(a)'</div>
        <div>Content-Length: 0'</div>
        <div>Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS,
          REFER'</div>
        <div>Supported: replaces'</div>
        <div>'</div>
        <div><br>
        </div>
        <div>#</div>
        <div>U 2010/08/17 22:28:38.548357 <a moz-do-not-send="true"
            href="http://212.230.19.191:5060">212.230.19.191:5060</a>
          -&gt; <a moz-do-not-send="true"
            href="http://80.26.81.96:26932">80.26.81.96:26932</a></div>
        <div><b><u>SIP/2.0 401 Unauthorized'</u></b></div>
        <div>Via: SIP/2.0/UDP 80.26.81.96:26932;branch=z9hG4bK-d2ee4e38'</div>
        <div>From: "1102" &lt;<a moz-do-not-send="true"
            href="mailto:sip%3A1102@212.230.19.191">sip:1102@212.230.19.191</a>&gt;;tag=36dcc698cfc16210o1'</div>
        <div>To: "1102" &lt;<a moz-do-not-send="true"
            href="mailto:sip%3A1102@212.230.19.191">sip:1102@212.230.19.191</a>&gt;;tag=00f209f5fddbfe1aa952cd699e41d531.97e5'</div>
        <div>Call-ID: <a moz-do-not-send="true"
            href="mailto:4aab2f50-775b4d34@80.26.81.96">4aab2f50-775b4d34@80.26.81.96</a>'</div>
        <div>CSeq: 10409 REGISTER'</div>
        <div>WWW-Authenticate: Digest realm="212.230.19.191",
          nonce="4c6b0d34000000caa164dcad25dbc5b4c6baefcef6dc84ae"'</div>
        <div>Server: Kamailio (1.5.4-notls (x86_64/linux))'</div>
        <div>Content-Length: 0'</div>
        <div>'</div>
      </div>
      <div><br>
      </div>
      <div>Could somebody help me? i can't find the real problem</div>
      <div><br>
      </div>
      <div>Thanks in advance</div>
      <div><br>
      </div>
      <div>DD</div>
      <div><br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com/">http://www.asipto.com/</a>
</pre>
  </body>
</html>