# # OpenSIPS residential configuration script # by OpenSIPS Solutions # # This script was generated via "make menuconfig", from # the "Residential" scenario. # You can enable / disable more features / functionalities by # re-generating the scenario with different options.# # # Please refer to the Core CookBook at: # https://opensips.org/Resources/DocsCookbooks # for a explanation of possible statements, functions and parameters. # ####### Global Parameters ######### /* uncomment the following lines to enable debugging */ #debug_mode=yes log_level=2 xlog_level=2 log_stderror=yes log_facility=LOG_LOCAL0 udp_workers=8 /* uncomment the next line to enable the auto temporary blacklisting of not available destinations (default disabled) */ #disable_dns_blacklist=no /* uncomment the next line to enable IPv6 lookup after IPv4 dns lookup failures (default disabled) */ #dns_try_ipv6=yes socket=udp:10.0.0.10:5060 # CUSTOMIZE ME ####### Modules Section ######## #set module path mpath="modules/" #### SIGNALING module loadmodule "signaling.so" #### StateLess module loadmodule "sl.so" #### Transaction Module loadmodule "tm.so" modparam("tm", "fr_timeout", 5) modparam("tm", "fr_inv_timeout", 30) modparam("tm", "restart_fr_on_each_reply", 0) modparam("tm", "onreply_avp_mode", 1) #### Record Route Module loadmodule "rr.so" /* do not append from tag to the RR (no need for this script) */ modparam("rr", "append_fromtag", 0) #### MAX ForWarD module loadmodule "maxfwd.so" #### SIP MSG OPerationS module loadmodule "sipmsgops.so" loadmodule "b2b_entities.so" modparam("b2b_entities", "server_hsize", 16) modparam("b2b_entities", "client_hsize", 16) ##modparam("b2b_entities", "script_req_route", "niso_request_entities") modparam("b2b_entities", "db_mode", 0) loadmodule "b2b_logic.so" #modparam("b2b_logic", "use_init_sdp", 1) modparam("b2b_logic", "hash_size", 12) #modparam("b2b_logic", "custom_headers_regexp", "/^X-/") #modparam("b2b_logic", "custom_headers", "Privacy;P-Asserted-Identity;Diversion;P-Early-Media;Reason;Date;Identity") #modparam("b2b_logic", "b2bl_from_spec_param", "$var(b2bl_from)") #modparam("b2b_logic", "init_callid_hdr", "X-uuid") modparam("b2b_logic", "server_address", "sip:uas@10.0.0.10:5060") modparam("b2b_logic", "db_mode", 0) modparam("b2b_logic", "script_req_route", "b2bl_request") #modparam("b2b_logic", "script_reply_route", "niso_reply") #modparam("b2b_logic", "cleanup_period", 60) #### FIFO Management Interface loadmodule "mi_fifo.so" modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo") modparam("mi_fifo", "fifo_mode", 0666) #### USeR LOCation module loadmodule "usrloc.so" modparam("usrloc", "nat_bflag", "NAT") modparam("usrloc", "working_mode_preset", "single-instance-no-db") #### REGISTRAR module loadmodule "registrar.so" modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT") /* uncomment the next line not to allow more than 10 contacts per AOR */ #modparam("registrar", "max_contacts", 10) #### ACCounting module loadmodule "acc.so" /* what special events should be accounted ? */ modparam("acc", "early_media", 0) modparam("acc", "report_cancels", 0) /* by default we do not adjust the direct of the sequential requests. if you enable this parameter, be sure to enable "append_fromtag" in "rr" module */ modparam("acc", "detect_direction", 0) loadmodule "proto_udp.so" loadmodule "cfgutils.so" ####### Routing Logic ######## # main request routing logic route { if (is_method("INVITE") && !has_totag()) { $var(x) = $RANDOM % 2; if ($var(x) == 0) $ru = "sip:10.0.0.212:7050"; else $ru = "sip:10.0.0.11:7050"; b2b_init_request("top hiding"); } } route [b2bl_request] { b2b_pass_request(); }