Hi all,
I have a problem with sending a call to PSTN gateway when
user is offline. I always get „404 Not found“ what is normal
because user is not in location database, but I don't understand why failure_route[1]
doesn't work. Below is my ser.cfg so if someone could help.
I’m using ser 0.9.3.
Any help would be appreciated.
Thanks
__________________________________
route{
#
initial sanity checks -- messages with
#
max_forwards==0, or excessively long requests
if
(!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};
if
(msg:len >= max_len ) {
sl_send_reply("513", "Message too big");
break;
};
if
(method=="REGISTER") record_route();
loose_route();
if
(uri==myself) {
if (method=="REGISTER") {
if (!www_authorize("srce.hr", "subscriber")) {
www_challenge("srce.hr", "0");
break;
};
save("location");
break;
};
lookup("aliases");
# if (!uri==myself) {
# append_hf("P-hint:
outbound alias\r\n");
# route(1);
# break;
# };
if
(method=="INVITE"){
t_on_failure("1");
};
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
route(2);
break;
};
};
if
(!t_relay()) {
sl_reply_error();
};
}
############
route[2] {
# non-Voip
-- just send "off-line"
if
(!(method == "INVITE" || method == "ACK" || method == "CANCEL"))
{
sl_send_reply("404", "Not Found");
break;
};
# forward
to gateway
rewritehostport("161.53.2.235:5060");
t_relay_to_udp("161.53.2.235", "5060");
}
failure_route[1] {
revert_uri();
rewritehostport("161.53.2.235:5060");
append_branch();
t_relay_to_udp("161.53.2.235", "5060");
}