Sorry- forgot to include these blocks.  The hunt table is basically a duplicate of aliases that we use to store hunt sequence info.

###
# Hunt to the next number in sequence
route[8] {
        # See if we're in a hunt
        if(search("P-hint: pt-hunt")) {
                xlog("L_NOTICE",
                     "wanted to hunt, but hunt already in progress\n");
                break;
        };

        # Assumes URI has been revert and prefixed with "h#-"
        # Also assumes t_on_failure (#+1) has been set.
        xlog("L_NOTICE", "%ci: r8: hunt on %ru\n");
        if(lookup("hunt")) {
                xlog("L_NOTICE",
                     "%ci: r8: hunt changed URI to %ru, relaying\n");
                append_branch();
                append_hf("P-hint: pt-hunt\r\n");
                setflag(9);
                t_relay();
                break;
        } else {
                xlog("L_NOTICE",
                     "%ci: r8: no further hunts, giving up\n");
        };

        break;

}

failure_route[1] { revert_uri(); prefix("h1-"); t_on_failure("2"); route(7); }
failure_route[2] { revert_uri(); prefix("h2-"); t_on_failure("3"); route(7); }
failure_route[3] { revert_uri(); prefix("h3-"); t_on_failure("4"); route(7); }
failure_route[4] { revert_uri(); prefix("h4-"); t_on_failure("5"); route(7); }
failure_route[5] { revert_uri(); prefix("h5-"); t_on_failure("6"); route(7); }
failure_route[6] { revert_uri(); prefix("h6-"); t_on_failure("7"); route(7); }
failure_route[7] { revert_uri(); prefix("h7-"); t_on_failure("8"); route(7); }
failure_route[8] { revert_uri(); prefix("h8-"); t_on_failure("9"); route(7); }
failure_route[9] { xlog("L_ERR", "too many hunts!\n"); }


On Apr 8, 2005 5:24 PM, Daniel Poulsen <dpoulsen@gmail.com> wrote:
> Could this:
>
> Apr  8 17:14:58 sip2 ser[17542]: BUG:t_check_status: t_pick_branch
> failed to get  a final response in MODE_ONFAILURE
>
> explain why this:
>
>        if (t_check_status("408") |   t_check_status("404") |
> t_check_status("486"))  { route(8); }
>
> fails?    Pertinant config follows.
>
> --------------------------
> Route logic:
> --------------------------
>
>         # Translate local address according to aliases table
>         if(lookup("aliases")) {
>                 xlog("L_NOTICE", "%ci: alias lookup changed uri to %ru\n");
>
>         };
>
>         # Handle offline or non-existent users
>         if (!lookup("location")) {
>                 xlog("L_NOTICE", "%ci: no location for %ru\n");
>         };
>
>         route(4); # relay with hunt on failure
>
> --------------------------
>
> route[4] {
>
>         # If an invitation, we want to hunt on failure
>         if(method == "INVITE") {
>                 t_on_failure("1");  # first hunt
>         };
>         if (!t_relay()) {
>                 sl_reply_error();
>                 break;
>         };
> }
>
> ###
> # Hunt (8), but only on 404/408/487
> route[7] {
>         if (t_check_status("408") |   # Timeout
>             t_check_status("404") |   # Not found
>             t_check_status("486"))    # Busy
>         {
>                 route(8);
>         } else {
>                 xlog("L_NOTICE",
>                      "%ci: r7: hunt but not 404/408/486\n");
>         };
> }
>