# Load required modules loadmodule "tm.so" loadmodule "sl.so" loadmodule "rr.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "rtpengine.so" loadmodule "dispatcher.so" loadmodule "nathelper.so" loadmodule "ctl" # Global parameters cfgengine "native" fork=yes children=4 log_facility=LOG_LOCAL0 # RTPProxy settings modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223") # Dispatcher settings modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list") # KAMCTL config modparam("ctl", "binrpc", "/var/run/kamailio/kamailio_ctl") # Main request routing logic route { # Max forward check if (!mf_process_maxfwd_header("10")) { sl_send_reply("483", "Too Many Hops"); exit; } # Record routing for stateful processing record_route(); # Load balance using dispatcher if (!ds_select_dst("0", "4")) { sl_send_reply("500", "No destination"); exit; } # Engage RTPProxy for RTP traffic if (is_method("INVITE")) { rtpengine_manage(); } # Forward the request t_relay(); }