2 # ----------- global configuration parameters ------------------------
10 check_via=no # (cmd. line: -v)
11 dns=no # (cmd. line: -r)
12 rev_dns=no # (cmd. line: -R)
14 fifo="/tmp/openser_fifo"
16 # ------------------ module loading ----------------------------------
18 loadmodule "/usr/lib/openser/modules/sl.so"
19 loadmodule "/usr/lib/openser/modules/tm.so"
20 loadmodule "/usr/lib/openser/modules/rr.so"
21 loadmodule "/usr/lib/openser/modules/textops.so"
22 loadmodule "/usr/lib/openser/modules/maxfwd.so"
23 loadmodule "/usr/lib/openser/modules/usrloc.so"
24 loadmodule "/usr/lib/openser/modules/registrar.so"
26 loadmodule "/usr/lib/openser/modules/nathelper.so"
28 loadmodule "/usr/lib/openser/modules/xlog.so"
31 ## ----------------- setting module-specific parameters ---------------
33 modparam("usrloc", "db_mode", 0)
35 modparam("rr", "enable_full_lr", 1)
37 modparam("nathelper", "rtpproxy_sock", "udp:localhost:22222")
39 # ------------------------- request routing logic -------------------
42 xlog("L_ERR", "@route: method <$rm> r-uri <$ru>\n");
44 # initial sanity checks -- messages with
45 # max_forwards==0, or excessively long requests
46 if (!mf_process_maxfwd_header("10")) {
47 sl_send_reply("483","Too Many Hops");
51 if (msg:len >= 2048 ) {
52 sl_send_reply("513", "Message too big");
56 # we record-route all messages -- to make sure that
57 # subsequent messages will go through our proxy; that's
58 # particularly good if upstream and downstream entities
59 # use different transport protocol
60 if (method!="REGISTER")
64 if (method=="BYE" || method=="CANCEL") {
68 # subsequent messages withing a dialog should take the
69 # path determined by record-routing
71 if (method=="INVITE") {
78 if (method=="INVITE") {
86 } else if (method=="REGISTER") {
92 if (method=="INVITE") {
98 # native SIP destinations are handled using our USRLOC DB
99 if (!lookup("location")) {
100 sl_send_reply("404", "Not Found");
104 if (method=="INVITE") {
113 # send it out now; use stateful forwarding as it works reliably
122 if (!save("location")) {
129 force_rtp_proxy("","83.64.208.28");
133 if (!search("^Content-Length:[ ]*0")) {