# # $Id: opensips.cfg 7027 2010-07-15 13:48:29Z razvancrainea $ # # OpenSIPS basic configuration script # by Anca Vamanu # # Please refer to the Core CookBook at: # http://www.opensips.org/index.php?n=Resources.DocsCookbooks # for a explanation of possible statements, functions and parameters. # ####### Global Parameters ######### debug=3 log_stderror=no fork=yes children=12 /* uncomment the next line to disable TCP (default on) */ disable_tcp=yes listen=udp:192.168.2.103:5080 listen=udp:192.168.2.103:5081 listen=udp:192.168.2.103:5082 listen=udp:192.168.10.4:5080 listen=udp:192.168.10.4:5081 ####### Modules Section ######## #set module path mpath="modules/" loadmodule "sl.so" loadmodule "tm.so" loadmodule "textops.so" loadmodule "rr.so" loadmodule "uri.so" loadmodule "maxfwd.so" modparam("tm", "wt_timer", 2) modparam("tm", "restart_fr_on_each_reply", 0) # ----------------- setting module-specific parameters --------------- ####### Routing Logic ######## # main request routing logic route{ if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { # route it out to whatever destination was set by loose_route() # in $du (destination URI). t_relay(); } else { /* uncomment the following lines if you want to enable presence */ ##if (is_method("SUBSCRIBE") && $rd == "your.server.ip.address") { ## # in-dialog subscribe requests ## route(2); ## exit; ##} if ( is_method("ACK") ) { if ( t_check_trans() ) { # non loose-route, but stateful ACK; must be an ACK after # a 487 or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction -> # ignore and discard exit; } } sl_send_reply("404","Not here"); } exit; } else record_route(); if (!t_relay()) { xlog("L_ERR","sl_reply_error\n"); sl_reply_error(); } }