<br>
Sorry- forgot to include these blocks. The hunt table is
basically a duplicate of aliases that we use to store hunt sequence
info.<br>
<br>
###<br>
# Hunt to the next number in sequence<br>
route[8] {<br>
# See if we're in a hunt<br>
if(search("P-hint: pt-hunt")) {<br>
xlog("L_NOTICE",<br>
"wanted to hunt, but hunt already in progress\n");<br>
break;<br>
};<br>
<br>
# Assumes URI has been revert and prefixed with "h#-"<br>
# Also assumes t_on_failure (#+1) has been set.<br>
xlog("L_NOTICE", "%ci: r8: hunt on %ru\n");<br>
if(lookup("hunt")) {<br>
xlog("L_NOTICE",<br>
"%ci: r8: hunt changed URI to %ru, relaying\n");<br>
append_branch();<br>
append_hf("P-hint: pt-hunt\r\n");<br>
setflag(9);<br>
t_relay();<br>
break;<br>
} else {<br>
xlog("L_NOTICE",<br>
"%ci: r8: no further hunts, giving up\n");<br>
};<br>
<br>
break;<br>
<br>
}<br>
<br>
failure_route[1] { revert_uri(); prefix("h1-"); t_on_failure("2"); route(7); }<br>
failure_route[2] { revert_uri(); prefix("h2-"); t_on_failure("3"); route(7); }<br>
failure_route[3] { revert_uri(); prefix("h3-"); t_on_failure("4"); route(7); }<br>
failure_route[4] { revert_uri(); prefix("h4-"); t_on_failure("5"); route(7); }<br>
failure_route[5] { revert_uri(); prefix("h5-"); t_on_failure("6"); route(7); }<br>
failure_route[6] { revert_uri(); prefix("h6-"); t_on_failure("7"); route(7); }<br>
failure_route[7] { revert_uri(); prefix("h7-"); t_on_failure("8"); route(7); }<br>
failure_route[8] { revert_uri(); prefix("h8-"); t_on_failure("9"); route(7); }<br>
failure_route[9] { xlog("L_ERR", "too many hunts!\n"); }<br>
<br><br>On Apr 8, 2005 5:24 PM, Daniel Poulsen <<a href="mailto:dpoulsen@gmail.com">dpoulsen@gmail.com</a>> wrote:<br>> Could this:<br>> <br>> Apr 8 17:14:58 sip2 ser[17542]: BUG:t_check_status: t_pick_branch<br>> failed to get a final response in MODE_ONFAILURE<br>> <br>> explain why this:<br>> <br>> if (t_check_status("408") | t_check_status("404") |<br>> t_check_status("486")) { route(8); }<br>> <br>> fails? Pertinant config follows.<br>> <br>> --------------------------<br>> Route logic:<br>> --------------------------<br>> <br>> # Translate local address according to aliases table<br>> if(lookup("aliases")) {<br>>
xlog("L_NOTICE", "%ci: alias lookup changed uri to %ru\n");<br>> <br>> };<br>> <br>> # Handle offline or non-existent users<br>> if (!lookup("location")) {<br>>
xlog("L_NOTICE", "%ci: no location for %ru\n");<br>> };<br>> <br>> route(4); # relay with hunt on failure<br>> <br>> --------------------------<br>> <br>> route[4] {<br>> <br>> # If an invitation, we want to hunt on failure<br>> if(method == "INVITE") {<br>>
t_on_failure("1"); # first hunt<br>> };<br>> if (!t_relay()) {<br>> sl_reply_error();<br>> break;<br>> };<br>> }<br>> <br>> ###<br>> # Hunt (8), but only on 404/408/487<br>> route[7] {<br>> if (t_check_status("408") | # Timeout<br>> t_check_status("404") | # Not found<br>>
t_check_status("486")) # Busy<br>> {<br>> route(8);<br>> } else {<br>> xlog("L_NOTICE",<br>> "%ci:
r7: hunt but not 404/408/486\n");<br>> };<br>> }<br>> <br>