All pastes #744842 Raw Edit

Untitled

public text v1 · immutable
·published 2007-10-21 20:55 UTC
rendered paste body
# Routing block for external and internal
route[2]
{
        xlog("now going into route-2\n");
        fix_nated_sdp("1");
        t_on_failure("1");
        if (uri=~"sip:\\*353+@.*") {
                append_hf("mailbox:$tU\r\n");
                sl_send_reply("100", "Trying");
                forward("mars.greenfieldtech.net:6060");
        }
        if (uri=~"sip:\\*151+@.*" || uri=~"sip:\\*252+@.*") {
                sl_send_reply("100", "Trying");
                rewritehostport("mars.greenfieldtech.net:6060");
        };
        t_relay();
}

# !! Nathelper
onreply_route[1] {
        #xlog("now going into onreply_route-1\n");
        # NATed transaction ?
        if (isbflagset(6) && status =~ "(183)|2[0-9][0-9]") {
                fix_nated_contact();
                force_rtp_proxy();
        # otherwise, is it a transaction behind a NAT and we did not
        # know at time of request processing ? (RFC1918 contacts)
        } else if (nat_uac_test("1")) {
                fix_nated_contact();
        };
}

failure_route[1] {
      xlog("now going into fail route with  $T_reply_code\n");
      if(t_check_status("(404)|(500)")) {
           # call failed - relay to voice mail
           xlog("Now in the if block, with status $T_reply_code\n");
           rewritehostport("mars.greenfieldtech.net:6060");
           #append_branch();
      }
       t_relay();
}