diff --git a/dispatcher.list b/dispatcher.list deleted file mode 100644 index 8cb8666..0000000 --- a/dispatcher.list +++ /dev/null @@ -1 +0,0 @@ -1 sip:10.0.5.7:5060 diff --git a/kamailio.cfg b/kamailio.cfg index 79c0c4e..a6e6fd9 100644 --- a/kamailio.cfg +++ b/kamailio.cfg @@ -25,11 +25,18 @@ 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") +modparam("dispatcher", "db_url", "mysql://kamailio:kamailiow@localhost/kamailio") +modparam("dispatcher", "ds_ping_interval", 10) +modparam("dispatcher", "ds_ping_method", "OPTIONS") +modparam("dispatcher", "ds_probing_threshold", 10) +modparam("dispatcher", "ds_inactive_threshold", 10) +modparam("dispatcher", "ds_ping_latency_stats", 1) +modparam("dispatcher", "ds_ping_from", "sip:kam@10.0.5.6") +modparam("dispatcher", "ds_probing_mode", 1) #Keeps pinging gateways when state is known (to detect change in state) # KAMCTL config modparam("ctl", "binrpc", "/var/run/kamailio/kamailio_ctl") # UAC settings -modparam("uac","reg_contact_addr", "10.0.5.7:5060") +modparam("uac","reg_contact_addr", "10.0.5.6:5060") modparam("uac","reg_db_url", "mysql://kamailio:kamailiow@localhost/kamailio") modparam("uac","auth_username_avp","$avp(auser)") modparam("uac","auth_password_avp","$avp(apass)") @@ -146,7 +153,17 @@ route[REQINIT] { } if(is_method("OPTIONS") && uri==myself && $rU==$null) { - sl_send_reply("200", "Keepalive"); +# sl_send_reply("200", "Keepalive"); + # update $du to set the destination address for proxying + if ($siz=="10.0.5.7") { + xlog("Incomming call from SIP provider"); + $du = "sip:" + "10.0.5.4"; + } else { + xlog("Incomming call from Customer PBX"); + $du = "sip:" + "10.0.5.7"; + } + t_on_failure("TRUNKAUTH"); + t_relay(); exit; }