# # $Id: serial_183.cfg 1817 2007-03-10 21:51:25Z miconda $ # # this example shows how to use forking on failure # log_stderror=1 fork=no listen=192.168.2.16 debug=3 # ------------------ module loading ---------------------------------- #set module path mpath="/usr/local/lib/openser/modules/" # Uncomment this if you want to use SQL database loadmodule "tm.so" loadmodule "sl.so" loadmodule "maxfwd.so" # ------------------------- request routing logic ------------------- # main routing logic route{ # initial sanity checks -- messages with # max_forwards==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }; if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); exit; }; /* skip register for testing purposes */ if (method=="REGISTER") { sl_send_reply("200", "ok"); exit; }; if (!method=="ACK") log(1, "forwarding now to primary destination\n"); if (method=="INVITE") { rewriteuri("sip:xxx@192.168.2.16:5064"); # if transaction broken, try other an alternative # route t_on_failure("1"); # if a provisional came, stop alternating t_on_reply("1"); }; t_relay(); } failure_route[1] { log(1, "trying at alternate destination\n"); append_branch("sip:yyy@192.168.2.16:5064"); t_relay(); } onreply_route[1] { log(1, "reply came in\n"); if (status=~"18[0-9]") { log(1, "provisional -- resetting negative failure\n"); t_on_failure("0"); }; }