Looks like you are not familiar with SER functions. Suggest you read the
document in
onsip.org.
Your routing logic direct the request to route(2) when user cannot be found
in location table. In route(2), you send a 404 reply and then "break". This
tells SER to stop processing further down the logic.
First, don't send 404 if you are going to try alternate path. The UAC may
terminate the transaction. Even if your PSTN answer, the UAC will not accept
it.
Second, just forward the call to PSTN.
Third, SER will only run failure_route with reply. In your case, you don't
even send the request. So, SER will never goes into failure_route.
Hope that make sense to you.
Zeus
-----Original Message-----
From: serusers-bounces(a)lists.iptel.org On Behalf Of davor jovanovic
Sent: Tuesday, 2 August 2005 9:07 PM
To: serusers(a)lists.iptel.org
Subject: [Serusers] failure_route problem
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");
}