debug=3 fork=no log_stderror=yes listen=192.168.1.15 port=5060 children=4 dns=no rev_dns=no 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 "xlog.so" loadmodule "avpops.so" loadmodule "mi_fifo.so" modparam("mi_fifo","fifo_name","/tmp/openser_fifo") modparam("usrloc","db_mode",0) modparam("rr","enable_full_lr",1) #modparam("tm","syn_branch",1) route{ if(!t_check_trans()) xlog("L_INFO","$Crx[ New Transaction ]$Cxx\n"); if(!t_check_trans()) { xlog("L_INFO","$Crx[ New Transaction ]$Cxx\n"); $var(trans)=$var(trans)+1; if([$var(trans)&1]) setflag(0); else resetflag(0); if([$var(trans)&2]) setflag(1); else resetflag(1); if([$var(trans)&4]) setflag(2); else resetflag(2); if([$var(trans)&8]) setflag(3); else resetflag(3); if([$var(trans)&16]) setflag(4); else resetflag(4); if([$var(trans)&32]) setflag(5); else resetflag(5); if([$var(trans)&64]) setflag(6); else resetflag(6); if([$var(trans)&128]) setflag(7); else resetflag(7); if([$var(trans)&256]) setflag(8); else resetflag(8); if([$var(trans)&512]) setflag(9); else resetflag(9); } if(!t_check_trans()) { xlog("L_INFO","$Crx[ New Transaction ]$Cxx\n"); $var(info)="new transaction " + $mf; } else $var(info)="transaction " + $mf; if($cl==0) $var(message)=$mb; else $var(message)=$mb + $Cyx + "{end}" + $Cxx + "\n"; xlog("L_INFO","$Cbg[ Method $rm from $si:$sp ]$Cxx\n$var(message)"); xlog("L_INFO","$Cbg[ End of Request ($var(info)) ]$Cxx\n"); t_on_reply("1"); if(!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); xlog("L_INFO","$CrxToo Many Hops$Cxx\n"); return; }; if(msg:len > max_len) { sl_send_reply("513","Message Overflow"); xlog("L_INFO","$CrxMessage Overflow$Cxx\n"); return; } if(method=="INVITE") { xlog("L_INFO","$CbxAdding Record-Route headers$Cxx\n"); record_route(); /* $var(rr-1)="Record-Route: \r\n"; $var(rr-2)="Record-Route: \r\n"; $var(rr-3)="Record-Route: \r\n"; $var(rr-4)="Record-Route: \r\n"; insert_hf( "$var(rr-4)$var(rr-3)$var(rr-2)$var(rr-1)", "From" ); */ } if(loose_route()) { xlog("L_INFO","$CbxLoose Route$Cxx\n"); route(1); } if(uri!=myself) { xlog("L_INFO","$CrxNot my URI$Cxx\n"); route(1); } if(method=="ACK") { xlog("L_INFO","$CbxMethod is ACK$Cxx\n"); route(1); } if(method=="REGISTER") { route(2); } lookup("aliases"); if(uri!=myself) { xlog("L_INFO","$CrxNot my URI after the lookup$Cxx\n"); route(1); } if(!lookup("location")) { sl_send_reply("404","User Not Found"); xlog("L_INFO","$CrxUser Not Found$Cxx\n"); return; } route(1); } route[1] { if(!t_relay()) sl_reply_error(); xlog("L_INFO","$CbxMessage is relayed; now exiting$Cxx\n"); exit; } route[2] { if(!save("location")) sl_reply_error(); xlog("L_INFO","$CbxLocation is saved; now exiting$Cxx\n"); exit; } onreply_route[1] { $var(info)="transaction " + $mf; if($cl==0) $var(message)=$mb; else $var(message)=$mb + $Cyx + "{end}" + $Cxx + "\n"; xlog("L_INFO","\n\n$Cbc[ Reply $rs ($rr) from $si:$sp concerning $rm ]$Cxx\n$var(message)$Cbc[ End of Reply ($var(info)) ]$Cxx\n\n\n"); }