# ----------- global configuration parameters ------------------------ log_facility=LOG_LOCAL0 unix_sock="/var/run/voipproxy/openser.sock" user=voipproxy group=voipproxy listen=1.2.3.4 # ------------------ module loading ---------------------------------- mpath="/usr/local/lib/openser/modules" loadmodule "nathelper.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "tm.so" loadmodule "rr.so" loadmodule "registrar.so" loadmodule "usrloc.so" loadmodule "sl.so" # 9Pass phone sets the Expires value to 3000, this is far too high. modparam("registrar", "max_expires", 600) # modparam("registrar", "sip_natping_flag", 7) modparam("nathelper", "rtpproxy_sock", "unix:/var/run/voipproxy/rtpproxy.sock") # This parameter comes from a patch I got here # http://www.openser.org/pipermail/devel/2006-February/002103.html # and allows to force the Contact HF. modparam("nathelper", "contact_expander", "1.2.3.4:5060") # ------------------ request-routing script -------------------------- # main routing logic route { if (!mf_process_maxfwd_header("10")) { sl_send_reply("483", "Too many hops"); return; } if (msg:len > max_len) { sl_send_reply("513", "Message too big"); return; }; loose_route(); if (method == "REGISTER") { fix_nated_register(); #fix_nated_contact(); #save_noreply("location"); } else { #lookup("htproxy"); if (method == "INVITE") { record_route(); force_rtp_proxy("r"); t_on_reply("1"); } else if (method == "BYE" || method == "CANCEL") { unforce_rtp_proxy(); }; }; fix_nated_contact(); /* * Set up reply processing and forward statefuly, so that we * don't bother rtpproxy each time we see a transaction. */ t_relay(); } onreply_route[1] { if (status =~ "(183)|2[0-9][0-9]") { force_rtp_proxy("r"); }; }