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; } # displaying only the INVITE requests if(method=="INVITE") { xlog("L_NOTICE","$rm from $si\n$Cbg$mb$Cxx\n"); if(search("^P-hint: [Ss]elf-[Ll]ooped")) { # if the second arrival relay it, without further processing # namely without another Record-Route (which will cause looping # of all messages of the dialog, e.g. of the BYE and its replies) xlog("L_NOTICE","Self-Looped INVITE is received\n"); if(search("^Proxy-Authorization:")) { xlog("L_NOTICE","$CrxThe credentials are being forwarded to the next hop:$Cxx\n"); xlog("L_NOTICE","$Crx$hdr(Proxy-Authorization[*])$Cxx\n"); } else xlog("L_NOTICE","$CgxNo credentials of the originating user are found$Cxx\n"); route(1); exit; } } if(method!="REGISTER") { record_route(); } if(loose_route()) { xlog("L_NOTICE","Loose Route $rm\n"); route(1); exit; } if(uri!=myself) { xlog("L_NOTICE","Not my URI\n"); route(1); exit; } if(method=="ACK") { xlog("L_NOTICE","ACK\n"); route(1); exit; } else if (method=="INVITE") { xlog("L_NOTICE","Processing by INVITE handler ...\n"); route(3); exit; } else if (method=="REGISTER") { xlog("L_NOTICE","REGISTER from $si\n"); route(2); exit; } lookup("aliases"); if(uri!=myself) { xlog("L_NOTICE","Not my URI after lookup for aliases\n"); route(1); exit; } if(!lookup("location")) { xlog("L_NOTICE","User is not found\n"); sl_send_reply("404","User Not Found"); exit; } xlog("L_NOTICE","Routing logic's last relay 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; } else if (!check_from()) { sl_send_reply("403","Use From=ID"); exit; } consume_credentials(); # Without consume_credentials() function the Proxy-Authorization header, # like the one shown below: # Proxy-Authorization: Digest username="11", realm="192.168.1.15", algorithm=MD5, uri="sip:10@192.168.1.15", nonce="4626337a5b022fd5e90dc62a4c2bd896c5a4d162", response="7d5221b309b68186651dd3af6f6f6dd0" # will be forwarded to the next hope, e.g. to # the callee User Agent lookup("aliases"); if(uri!=myself) { route(1); exit; } if(!lookup("location")) { sl_send_reply("404","User Not Found"); exit; } append_hf("P-hint: Self-Looped\r\n"); xlog("L_NOTICE","Sending out first to myself for examining the content\n"); t_relay("192.168.1.15"); exit; route(1); } onreply_route[1] { xlog("L_NOTICE","$Cbx$rs ($rr) concerning $rm$Cxx\n"); }