Hello sr-users,<br><br>I&#39;m new using kamailio open source, and I would like to ask for help.<br><br>My version is 3.1.4 and I am trying to configure 3 servers, one with proxy, one with registrar and one with location server. <br>
<br>My problem is when I try to send a register message it returns an error &quot;401 Unauthorized&quot;, I know the error is in the fuction www_authorize(&quot;10.254.239.7&quot;, &quot;subscriber&quot;) but I don&#39;t know how to solve it, for me it seems correct the parameters. <br>
<br>Below I have attatched the proxy and registrar relevant route code for my problem, and the IPs for proxy an registrar are: 10.254.239.7-----------10.254.239.8 <br><br>If someone can help me, I will be gratefull. Thanks in advance.<br>
<br>####REGISTRAR CODE<br><br><div class="gmail_quote">route{<br><br>       # initial sanity checks -- too long messages<br>       if (msg:len &gt;=  2048 ) {<br>               sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>
               exit;<br>       };<br>
<br>       if (!uri==myself) {<br>               sl_send_reply(&quot;400&quot;, &quot;Bad destination, only register messages de$<br>               exit;<br>       };<br><br>       # the only valid message for the registrar is the register message<br>
       # other messages are answered with an error message<br>       if (uri==myself) {<br><br>               if (method==&quot;REGISTER&quot;) {<br>
<br>                       sl_send_reply(&quot;100&quot;, &quot;Trying&quot;);<br><br>               if (!www_authorize(&quot;10.254.239.7&quot;, &quot;subscriber&quot;)) {<br>                       www_challenge(&quot;10.254.239.7&quot;, &quot;1&quot;);<br>

                       exit;<br>               };<br><br>               if (!check_to()) {<br>                       sl_send_reply(&quot;401&quot;, &quot;Unauthorized&quot;);<br>                       exit;<br>               };<br>

<br>                consume_credentials();<br>                       if(!save(&quot;location&quot;)) {<br>                               sl_reply_error();<br>                       };<br>                       exit;<br>               } else {<br>

                       sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>                       exit;<br>               };<br>       };<br>}<br><br>#########PROXY CODE<br><br>               if (method==&quot;ACK&quot;) {<br>
                route(1);<br>
                exit;<br>                } if (method==&quot;INVITE&quot;) {<br>                route(3);<br>                exit;<br>                } else if (method==&quot;REGISTER&quot;) {<br>                route(2);<br>

                exit;<br>                 };<br><br>               lookup(&quot;aliases&quot;);<br>               if (!uri==myself) {<br>                       route(1);<br>               };<br><br>route[2] {<br>       #rewrinting the host allows the registrar to know that the message is de$<br>
<br>       rewritehost(&quot;10.254.239.8&quot;);<br>
       if(!t_relay()) {<br>               sl_reply_error();<br>       };<br>       exit;<br>}<br><br><br><br>
</div><br>