Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####### Global Parameters #########
- debug=2
- log_stderror=no
- memdbg=5
- memlog=5
- log_facility=LOG_LOCAL0
- fork=yes
- children=4
- port=5060
- ####### Modules Section ########
- # set paths to location of modules
- mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"
- loadmodule "tm.so"
- loadmodule "sl.so"
- loadmodule "pv.so"
- loadmodule "maxfwd.so"
- loadmodule "dispatcher.so"
- # ----------------- setting module-specific parameters ---------------
- # ----- tm params -----
- # auto-discard branches from previous serial forking leg
- modparam("tm", "failure_reply_mode", 3)
- # default retransmission timeout: 30sec
- modparam("tm", "fr_timer", 30000)
- # default invite retransmission timeout after 1xx: 120sec
- modparam("tm", "fr_inv_timer", 120000)
- # ----- dispatcher params -----
- modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")
- modparam("dispatcher", "flags", 2)
- modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
- modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
- modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
- ####### Routing Logic ########
- # Main SIP request routing logic
- route {
- if ( !mf_process_maxfwd_header("10") )
- {
- sl_send_reply("483","To Many Hops");
- exit;
- }
- # select from first dst group by round-robin
- if(!ds_select_dst("1", "4"))
- {
- sl_send_reply("500", "No destination available");
- exit;
- }
- t_on_failure("RTF_DISPATCH");
- if(!t_relay())
- {
- sl_reply_error();
- exit;
- }
- }
- # dispatcher failure routing block
- failure_route[RTF_DISPATCH] {
- if (t_is_canceled()) {
- exit;
- }
- # select next destination only for local timeout
- if (t_branch_timeout() && !t_branch_replied())
- {
- if(ds_next_dst())
- {
- t_on_failure("RTF_DISPATCH");
- t_relay();
- exit;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement