debug=3 children=4 fork=no log_stderror=yes listen=192.168.1.15 port=5060 mpath="/usr/lib/openser/modules/" loadmodule "sl.so" loadmodule "tm.so" loadmodule "rr.so" loadmodule "maxfwd.so" loadmodule "usrloc.so" loadmodule "registrar.so" loadmodule "textops.so" loadmodule "mi_fifo.so" loadmodule "xlog.so" modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo") modparam("usrloc", "db_mode", 0) modparam("rr", "enable_full_lr", 1) route{ xlog("L_NOTICE","route{...}\n"); route(3); #route(2); xlog("L_NOTICE","$Cbg [ $rm from $si:$sp ] $Cxx\n$mb\n"); xlog("L_NOTICE","$Cbg [ End of $rm flagged $mf ] $Cxx\n"); t_on_reply("1"); 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; }; if(!search("P-hint: [Ss]elf-[Ll]ooped")) { if(method=="REGISTER") { append_hf("P-hint: Self-looped request\r\n"); t_relay("192.168.1.15"); exit; } } if (!method=="REGISTER") record_route(); if (loose_route()) { route(1); }; if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(1); }; if (uri==myself) { if (method=="REGISTER") { save("location"); exit; }; lookup("aliases"); if (!uri==myself) { append_hf("P-hint: outbound alias\r\n"); route(1); }; if (!lookup("location")) { sl_send_reply("404", "Not Found"); exit; }; append_hf("P-hint: usrloc applied\r\n"); }; route(1); } route[1] { # 0x01 flag disables the sending of provisional 100 (Trying) and # the calling UA will retransmit its INVITE request in case # the callee UA do not reply (UA would not retransmit after 100-Trying) if (!t_relay("0x01")) { sl_reply_error(); }; exit; } onreply_route[1] { xlog("L_NOTICE","onreply_route[1] {...}\n"); route(3); #route(2); xlog("L_NOTICE","$Cbc [ $rs ($rr) from $si:$sp concerning $rm ] $Cxx\n$mb\n"); xlog("L_NOTICE","$Cbc [ End of $rs flagged $mf ] $Cxx\n"); } route[3] { if($mf!=0) xlog("L_NOTICE","an on-going transaction ...\n"); else { xlog("L_NOTICE","$Crxnew transaction or lost flags ...$Cxx\n"); $var(trans)=$var(trans)+1; if([$var(trans)&1]) setflag(0); if([$var(trans)&2]) setflag(1); if([$var(trans)&4]) setflag(2); if([$var(trans)&8]) setflag(3); } } # this version better distingueshes whether the message belongs # to an on-going transaction or not, but this version is # unstable, because of t_check_trans() which sudenly exits # the script when analyzing a retransmitted INVITE route[2] { # now calling t_check_trans() without checking the return # because of the bug with ACK requests which returns a wrong # value for the first function call (case of a cancelled call setup) t_check_trans(); if(t_check_trans()) xlog("L_NOTICE","an on-going transaction ...\n"); else { xlog("L_NOTICE","$Crxa new transaction ...$Cxx\n"); $var(trans)=$var(trans)+1; if([$var(trans)&1]) setflag(0); if([$var(trans)&2]) setflag(1); if([$var(trans)&4]) setflag(2); if([$var(trans)&8]) setflag(3); } }