<br>
<br>
Hi-<br>
<br>
I am having a problem where if I parallel fork a call, my failure_route
gets called after the caller hangs up. I thought adding
t_check_status("487") to the failure_route would take care of that, but
it still t_relays when I don't want it to. This only seems to be
a problem if it parallel forks and one of the SIP targets is not
available. If I dial an alias with a single [not forked] target
the t_check_status("487") works fine.<br>
<br>
Here is my code.. any thoughts?<br>
<br>
Thanks much.<br>
<br>
Dan<br>
<br>
route {<br>
<br>
<<<< Registration code snipped for brevity >>>><br>
<br>
if(lookup("aliases")) {<br>
xlog("L_NOTICE", "%ci: alias lookup changed uri to %ru\n");<br>
<br>
# If alias points outbound, forward it without question.<br>
if (!(uri==myself)) {<br>
xlog("L_NOTICE", "%ci: outbound alias\n");<br>
route(4); # relay with hunt on failure<br>
break;<br>
};<br>
};<br>
<br>
<br>
if ( (uri=~"^sip:911@.*") | (uri=~"^sip:011[0-9]+@.*") |<br>
(uri=~"^sip:1[0-9]{10}@.*") ) {<br>
<br>
route(3); <br>
break;<br>
};<br>
<br>
# Local location<br>
route(4); # relay with hunt on failure<br>
<br>
} /* end of initial routing logic */<br>
<br>
route[4] {<br>
xlog("L_INFO", "r4: Relay with Hunt\n");<br>
# If an invitation, we want to hunt on failure<br>
if(method == "INVITE") {<br>
t_on_failure("1"); # first hunt<br>
};<br>
<br>
if (!lookup("location")) {<br>
xlog("L_NOTICE", "%ci: no location for %ru\n");<br>
};<br>
<br>
append_hf("P-hint: relay\r\n");<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
break;<br>
};<br>
}<br>
<br>
<br>
failure_route[1] {<br>
<br>
xlog("L_INFO", "failure+route+1 %ru\n");<br>
<br>
revert_uri();<br>
setflag(9);<br>
<br>
# Check to see if the call was cancelled<br>
if( t_check_status("487") | method == "CANCEL") {<br>
xlog("L_INFO", "t_check_status is 487\n");<br>
break;<br>
}<br>
<br>
prefix("h1-");<br>
if(lookup("hunt")) { # Hunt table is an exact copy of aliases<br>
xlog("L_NOTICE",<br>
"%ci: fail_r_1: hunt changed URI to %ru, relaying\n");<br>
append_branch();<br>
append_hf("P-hint: pt-hunt\r\n");<br>
t_relay();<br>
break;<br>
} else {<br>
xlog("L_NOTICE",<br>
"%ci: r8: no further hunts, giving up\n");<br>
break;<br>
};<br>
<br>
}<br>
<br>
<br>