debug=3 fork=no log_stderror=yes listen=192.168.1.15 port=5060 children=4 dns=no rev_dns=no mpath="/usr/local/lib/openser/modules/" loadmodule "mysql.so" loadmodule "sl.so" loadmodule "tm.so" loadmodule "rr.so" loadmodule "maxfwd.so" loadmodule "usrloc.so" loadmodule "registrar.so" loadmodule "auth.so" loadmodule "auth_db.so" loadmodule "uri_db.so" loadmodule "mi_fifo.so" loadmodule "xlog.so" loadmodule "textops.so" modparam("auth_db","calculate_ha1",1) modparam("auth_db","password_column","password") modparam("usrloc","db_mode",2) modparam("rr","enable_full_lr",1) modparam("mi_fifo","fifo_name","/tmp/openser_fifo") route { t_on_reply("1"); if(!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } if(msg:len>max_len) { sl_send_reply("513","Message Overflow"); exit; } # Adds a time header to the reply of the request. append_time(); append_to_reply("Foo: $rm at $Ts\r\n"); # If INVITE and is the first arrival then the proxy # transmits the message to itself without processing. # The looped arrival path will result in a looped # path of replies (thanks to Via fields). Looped # replies perimt us to see the replies of the proxy # itself. For example we can see the provisional 100 # (Trying) replies of the proxy. if(method=="INVITE") { if(!search("^P-hint: [Ss]elf-[Ll]ooped")) { append_hf("P-hint: Self-Looped\r\n"); t_relay("192.168.1.15"); # IP address of this proxy server exit; } } # Only the second arrival of INVITE will be displayed. if(method=="REGISTER") { # short display for register messages $var(msg)=""; $var(msg)=$var(msg)+$Cbg+"Via: " + $hdr(Via[*]) + $Cxx + "\n"; $var(msg)=$var(msg)+$Cbg+"To: " + $hdr(To[*]) + $Cxx + "\n"; $var(msg)=$var(msg)+$Cbg+"Contact: " + $hdr(Contact[*]) + $Cxx + "\n"; if(search("^Authorization: ")) { $var(msg)=$var(msg)+$Cbg+"Authorization: " + $hdr(Authorization[*]) + $Cxx + "\n"; $var(msg)=$var(msg)+$Cyg+$au+"@"+$ar+$Cxx+"\n"; } xlog("L_NOTICE","REGISTER from $si ($Tf)\n$var(msg)"); } else xlog("L_NOTICE","$rm ($Tf)\n$Cbg$mb$Cxx\n"); # Record-Route only a single pass through the proxy server. # The record_route() function is called only for the second # arrival of INVITE. Otherwise all further transactions of # the dialog (e.g. BYE) will also follow the looped path. if(method!="REGISTER") { record_route(); } if(loose_route()) { xlog("L_NOTICE","Loose route\n"); route(1); exit; } if(uri!=myself) { xlog("L_NOTICE","URI is not mine\n"); route(1); exit; } if(method=="ACK") { route(1); exit; } else if (method=="INVITE") { route(3); exit; } else if (method=="REGISTER") { route(2); exit; } lookup("aliases"); if(uri!=myself) { route(1); exit; } if(!lookup("location")) { sl_send_reply("404","User Not Found"); exit; } xlog("L_NOTICE","The last route statement\n"); route(1); } route[1] { if(!t_relay()) { sl_reply_error(); } } route[2] { /* sl_send_reply("100","Trying to Register"); if(!www_authorize("","subscriber")) { www_challenge("","0"); exit; } if(!check_to()) { sl_send_reply("401","Unauthorized"); exit; } consume_credentials(); */ if(!save("location")) { sl_reply_error(); } } route[3] { if(!proxy_authorize("","subscriber")) { proxy_challenge("","0"); exit; } if (!check_from()) { sl_send_reply("403","Forbidden"); exit; } consume_credentials(); lookup("aliases"); if(uri!=myself) { route(1); exit; } if(!lookup("location")) { sl_send_reply("404","User Not Found"); exit; } route(1); } onreply_route[1] { xlog("L_NOTICE","$rs ($rr) concerning $rm\n$Cbc$mb$Cxx\n"); }