Hi Yago,
use debug messages in your script (log / xlog) to trace the script
execution - see if the t_on_failure is reached, if the failure route is
entered, etc...
regards,
bogdan
Yago Bargalló wrote:
Hello all,
I don’t know why my openser.cfg doesn’t work correctly, I want my
openser to catch the failure_route after 10 seconds to reroute a call
to a Asterisk when nobody responds the phone on an openser.
Does anybody know what I’m doing wrong??
Thanks in advance!!!!!!!!!
Openser.cfg:
modparam("tm","fr_timer",4)
modparam("tm", "fr_inv_timer" ,10)
# ------------------------- request routing logic -------------------
# main routing logic
(…)
route{
(…)
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("172.16.51.150", "subscriber")) {
www_challenge("172.16.51.150", "0");
exit;
};
save("location");
exit;
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
};
#
if(uri=~"sip:2[0-9]+@") {
* t_on_failure("1");*
# rewritehostport("172.16.51.160:5060");
# t_relay();
# rewriteuser("2002");
# exit;
}
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};
route(1);
}
route[1] {
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
exit;
}
* *
*failure_route[1] {*
* #reroute to asterisk*
* rewritehost("172.16.51.150");*
* rewriteuser("2002");*
* t_relay();*
* exit;*
*}*
* *
------------------------------------------------------------------------
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users