failure_route works with the original request (not response). SER will
trigger failure_route when it decides what response code (from which
branch) should be forwarded upstream. It is not possible to call
force_rtp_proxy in this section, you should call force_rtp_proxy in the
main routing section.
Jan.
On 07-04 13:45, Vitaly Nikolaev wrote:
Hello,
I have small problem with dinamic routing.. my config looks like:
(page down)
as u see i have two steps routing.. second exec_dset return me uri of
voicemail or it could be another number. the question is:
how can i do rtp_proxy on second step ? i can not just put
force_rtp_proxy(); in failure_route.. it is not allowed....
Please help
short version:
route {
if (nat_uac_test("2")) {
xlog("L_ALERT", "(%ci) src address different than via
header->NAT detected");
force_rport();
fix_nated_contact();
setflag(5);
}
if(uri==myself) {
exec_dset("/usr/local/ser/bin/getroute");
route(1);
}
}
route [1] {
xlog("L_ALERT", "(%ci) entering route[1] - relaying SIP message to
online user\n");
if ((isflagset(5)) || (isflagset(6))) {
xlog("L_ALERT", "(%ci) at least one of the participants is
NATed->record_route\n");
record_route();
xlog("L_ALERT", "(%ci) -->setting up reply
processing ->onreply_route[1]");
t_on_reply("1");
if (method=="INVITE") {
xlog("L_ALERT", "(%ci) INVITE
request-->force_rtp_proxy, set NATED-INVITE flag(7)");
force_rtp_proxy();
append_hf("P-hint: request forced to rtp proxy\r\n");
setflag(7);
};
};
t_on_failure("1");
xlog("L_ALERT", "(%ci) relaying message ...(%tu)");
if (!t_relay()) {
xlog("L_ALERT", "(%ci) t_relay error occured\n");
sl_reply_error();
};
}
onreply_route[1] {
xlog("L_ALERT", "(%ci) onreply_route[1] entered\n");
if ( (status=~"200" || status=~"183") ) {
xlog("L_ALERT", "(%ci) status 2xx or 183");
if ( isflagset(7) ) {
xlog("L_ALERT", "(%ci) marked(7) as NATED-INVITE
-> force_rtp_proxy \n");
force_rtp_proxy();
append_hf("P-hint: response forced to rtp proxy\r\n");
};
};
}
failure_route[3] {
/* XX: note: unsafe if preloaded routes without username used */
xlog("L_ALERT", "(%ci) failureroute[1] entered\");
exec_dset("/usr/local/ser/bin/getroute vm");
t_on_failure("4");
xlog("L_ALERT", "(%ci) relaying message ...(%tu)");
append_branch();
if (!t_relay()) {
xlog("L_ALERT", "(%ci) t_relay error occured\n");
# sl_reply_error();
};
}
_______________________________________________
Serusers mailing list
serusers(a)lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers