<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
On 9/12/11 4:14 PM, neili ma wrote:
<blockquote
cite="mid:CABPYhvv1NeQvFLYCAb=+2_LbQ3s2f8jjpqV-ad1N3XFaUJ=2tg@mail.gmail.com"
type="cite">Hello,<br>
<br>
Thanks a lot for your advice, I found and solved the problem
thanks to the debugger, actually the problem was with <br>
<br>
modparam("auth_db",
"db_url","mysql://openser:openserrw@localhost/openser")<br>
<br>
I just had to change localhost to my locationserver IP and the
problem was solved :), thanks again.<br>
</blockquote>
<br>
good that you find it. Don't forget to cc the mailing list always so
people reading the thread (archive later) see the conclusion -- it
can help many others running on same situation.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote
cite="mid:CABPYhvv1NeQvFLYCAb=+2_LbQ3s2f8jjpqV-ad1N3XFaUJ=2tg@mail.gmail.com"
type="cite"><br>
Sincerely,<br>
Neili<br>
<br>
<br>
<div class="gmail_quote">2011/9/12 Daniel-Constantin Mierla <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
<br>
you have another group of actions that can send 401
Unauthorized:
<div class="im"><br>
<br>
if (!check_to()) {<br>
sl_send_reply("401",
"Unauthorized");<br>
exit;<br>
}<br>
<br>
</div>
You can either run with debug=4 and watch the syslog to see
some hints in messages where it fires this 401, or use
debugger module with cfgtrace option set and you see the
execution path of the config in the logs.<br>
<br>
If you send here the ngrep of such REGISTER and the reply we
can spot what could be the situation for 401.<br>
<br>
Cheers,<br>
Daniel
<div>
<div class="h5"><br>
<br>
On 9/11/11 9:18 PM, neili ma wrote: </div>
</div>
<blockquote type="cite">
<div>
<div class="h5">Hello sr-users,<br>
<br>
I'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 "401 Unauthorized", I know the error
is in the fuction www_authorize("10.254.239.7",
"subscriber") but I don'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 >= 2048 ) {<br>
sl_send_reply("513", "Message too
big");<br>
exit;<br>
};<br>
<br>
if (!uri==myself) {<br>
sl_send_reply("400", "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=="REGISTER") {<br>
<br>
sl_send_reply("100",
"Trying");<br>
<br>
if (!www_authorize("10.254.239.7",
"subscriber")) {<br>
www_challenge("10.254.239.7",
"1");<br>
exit;<br>
};<br>
<br>
if (!check_to()) {<br>
sl_send_reply("401",
"Unauthorized");<br>
exit;<br>
};<br>
<br>
consume_credentials();<br>
if(!save("location")) {<br>
sl_reply_error();<br>
};<br>
exit;<br>
} else {<br>
sl_send_reply("403",
"Forbidden");<br>
exit;<br>
};<br>
};<br>
}<br>
<br>
#########PROXY CODE<br>
<br>
if (method=="ACK") {<br>
route(1);<br>
exit;<br>
} if (method=="INVITE") {<br>
route(3);<br>
exit;<br>
} else if (method=="REGISTER") {<br>
route(2);<br>
exit;<br>
};<br>
<br>
lookup("aliases");<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("10.254.239.8");<br>
if(!t_relay()) {<br>
sl_reply_error();<br>
};<br>
exit;<br>
}<br>
<br>
<br>
<br>
</div>
<br>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<font color="#888888"> <br>
<pre cols="72">--
Daniel-Constantin Mierla -- <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a moz-do-not-send="true" href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
</font></div>
</blockquote>
</div>
<br>
</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>
Kamailio Advanced Training, Oct 10-13, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
</body>
</html>