I just had to change localhost to my locationserver IP and the
problem was solved :), thanks again.
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.
you have another group of actions that can send 401
Unauthorized:
if (!check_to()) {
sl_send_reply("401",
"Unauthorized");
exit;
}
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.
If you send here the ngrep of such REGISTER and the reply we
can spot what could be the situation for 401.
Cheers,
Daniel
On 9/11/11 9:18 PM, neili ma wrote:
Hello sr-users,
I'm new using kamailio open source, and I would like
to ask for help.
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.
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.
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
If someone can help me, I will be gratefull. Thanks in
advance.
####REGISTRAR CODE
route{
# initial sanity checks -- too long messages
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too
big");
exit;
};
if (!uri==myself) {
sl_send_reply("400", "Bad
destination, only register messages de$
exit;
};
# the only valid message for the registrar is
the register message
# other messages are answered with an error
message
if (uri==myself) {
if (method=="REGISTER") {
sl_send_reply("100",
"Trying");
if (!www_authorize("10.254.239.7",
"subscriber")) {
www_challenge("10.254.239.7",
"1");
exit;
};
if (!check_to()) {
sl_send_reply("401",
"Unauthorized");
exit;
};