{\rtf1\ansi\ansicpg1252\deff0\deflang3084{\fonttbl{\f0\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 debug=4\par log_stderror=yes\par \par memdbg=5\par memlog=5\par \par log_facility=LOG_LOCAL0\par \par fork=yes\par children=4\par \par auto_aliases=yes\par \par \par port=5060\par \par advertised_address=72.55.182.125\par \par mpath="/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/"\par \par loadmodule "db_mysql.so"\par loadmodule "tm.so" # transactions, t_relay()\par loadmodule "sl.so"\par loadmodule "rr.so"\par loadmodule "pv.so"\par loadmodule "usrloc.so"\par loadmodule "siputils.so"\par loadmodule "textops.so"\par loadmodule "registrar.so"\par loadmodule "xlog.so"\par loadmodule "ctl.so"\par loadmodule "nathelper.so"\par \par loadmodule "avpops.so"\par \par ### Omnity major module additions end ###\par \par # ----- rr params -----\par # add value to ;lr param to cope with most of the UAs\par modparam("rr", "enable_full_lr", 1)\par # do not append from tag to the RR (no need for this script)\par modparam("rr", "append_fromtag", 0)\par \par modparam("usrloc", "db_mode", 1) # @todo : Review best DB_MODE\par modparam("usrloc", "nat_bflag", 6) \par \par # Long delay for retransmission absorption, see ticket #12759\par # RFC asks for 30 seconds, not the default 5 seconds!\par modparam("tm", "wt_timer", 30000 )\par \par # @todo : Needed for SIP ping in nathelper\par modparam("registrar", "received_avp", "$avp(i:801)")\par \par # MySQL\par modparam("db_mysql", "ping_interval", 30)\par modparam("db_mysql", "auto_reconnect", 1)\par \par # view must have uuid, username, attribute, value, type (and domain)\par modparam("avpops", "avp_table", "avptable")\par \par modparam("usrloc", "db_url", "mysql://kamailio_dev:kamailio4none@192.168.41.105/kamailio_dev")\par modparam("avpops", "db_url", "mysql://kamailio_dev:kamailio4none@192.168.41.105/kamailio_dev")\par \par # main request routing logic\par \par route\{\par \par xlog("L_INFO", "New request - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\\n");\par \par \tab # NAT detection\par \tab force_rport();\par \tab if (nat_uac_test("19")) \{\par \tab\tab if (method=="REGISTER") \{\par \tab\tab\tab fix_nated_register();\par \tab\tab\} else \{\par \tab\tab\tab fix_nated_contact();\par \tab\tab\}\par \tab\tab setflag(5);\par \tab\}\par \par \par \tab if (method == CANCEL) \{\par \tab\tab if (!t_relay_cancel()) \{ # implicit drop if relaying was successful,\par \tab # nothing to do\par \par \tab\tab\tab # corresponding INVITE transaction found but error occurred\par \tab\tab\tab sl_reply("500", "Internal Server Error");\par \tab\tab\tab drop;\par \tab\tab\}\par \tab\tab # bad luck, corresponding INVITE transaction is missing,\par \tab\tab # do the same as for INVITEs\par \tab\}\par \par \par \tab # authentication\par # Register has it's own auth method\par \tab if (is_method("SUBSCRIBE") )\par \{\par sl_send_reply(403, 'Go away');\par exit ;\par \}\par \tab if (is_method("REGISTER"))\par \{\par route(REGISTER);\par \}\par \par \tab if (has_totag()) \{\par \tab\tab # sequential request withing a dialog should\par \tab\tab # take the path determined by record-routing\par \tab\tab if (loose_route()) \{\par \tab\tab\tab if (is_method("BYE")) \{\par \tab\tab\tab\tab setflag(1); # do accounting ...\par \tab\tab\tab\tab setflag(3); # ... even if the transaction fails\par \tab\tab\tab\}\par \tab\tab\tab route(T_RELAY);\par \tab\tab\} else \{\par \tab\tab\tab if ( is_method("ACK") ) \{\par \tab\tab\tab\tab if ( t_check_trans() ) \{\par \tab\tab\tab\tab\tab # non loose-route, but stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream server\par \tab\tab\tab\tab\tab t_relay();\par \tab\tab\tab\tab\tab exit;\par \tab\tab\tab\tab\} else \{\par \tab\tab\tab\tab\tab # ACK without matching transaction ... ignore and discard.\\n");\par \tab\tab\tab\tab\tab exit;\par \tab\tab\tab\tab\}\par \tab\tab\tab\}\par \tab\tab\tab sl_send_reply("404","Not here");\par \tab\tab\}\par \tab\tab exit;\par \tab\}\par \par \tab #initial requests\par \par if ( is_method('NOTIFY' ) )\par \{\par sl_send_reply('200', 'OK');\par exit; \par \}\par if (is_method("OPTIONS"))\par \{\par if (uri==myself) \{\par if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) \{\par options_reply();\par \} \par \} \par \} \par \par \tab # CANCEL processing\par if (is_method("CANCEL"))\par \{\par if (t_check_trans())\par t_relay();\par exit;\par \}\par \par t_check_trans();\par \par record_route();\par \par if ( !lookup('location') )\par \{\par sl_send_reply('404', 'Not found');\par exit; \par \}\par route(T_RELAY);\par \}\par \par route[T_RELAY] \{\par \par \tab if (!t_relay()) \{\par \tab\tab sl_reply_error();\par \tab\}\par \}\par route[REGISTER] \{\par # Left to handle; unregister\par \par if (!save("location" ) ) # , "0x04"))\par \{\par xlog("L_ERR", "Saving contact failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\\n");\par sl_reply_error();\par exit;\par \}\par \par xlog("L_INFO", "Registration successful - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\\n");\par exit;\par \}\par }