working options and failover with and without probe

This commit is contained in:
2024-09-11 16:37:26 +02:00
parent 536d511de8
commit 1cde1be3eb

View File

@@ -5,7 +5,7 @@ loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "rtpengine.so"
#loadmodule "dispatcher.so"
loadmodule "dispatcher.so"
loadmodule "nathelper.so"
loadmodule "ctl"
loadmodule "pv"
@@ -25,9 +25,9 @@ log_facility=LOG_LOCAL0
# RTPProxy settings
modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
# Dispatcher settings
#modparam("dispatcher", "db_url", "mysql://kamailio:kamailiow@localhost/kamailio")
modparam("dispatcher", "db_url", "mysql://kamailio:kamailiow@localhost/kamailio")
#modparam("dispatcher", "ds_ping_interval", 10)
#modparam("dispatcher", "ds_ping_method", "OPTIONS")
#modparam("dispatcher", "ds_ping_method", "REGISTER")
#modparam("dispatcher", "ds_probing_threshold", 10)
#modparam("dispatcher", "ds_inactive_threshold", 10)
#modparam("dispatcher", "ds_ping_latency_stats", 1)
@@ -45,10 +45,16 @@ modparam("uac","auth_realm_avp","$avp(arealm)")
# TM settings
modparam("tm", "auto_inv_100_reason", "Trying")
/* Main SIP request routing logic
* - processing of any incoming SIP request starts with this route
* - note: this is the same as route { ... } */
request_route {
# Variables
$avp(customerpbxip)="10.0.5.4";
$avp(sip1)="10.0.5.7";
$avp(sip2)="10.0.5.5";
# per request initial checks
route(REQINIT);
@@ -110,17 +116,19 @@ route[RELAY] {
}
# update $du to set the destination address for proxying based on caller IP
if ($siz=="10.0.5.7") {
if ($siz==$avp(sip1) || $siz==$avp(sip2)) {
xlog("Incomming call from SIP provider");
$du = "sip:" + "10.0.5.4";
# $du = "sip:" + "10.0.5.4";
$du = "sip:" + $avp(customerpbxip);
} else {
xlog("Incomming call from Customer PBX");
$du = "sip:" + "10.0.5.7";
# $du = "sip:" + "10.0.5.7";
ds_select_dst("1","9");
}
if ($siz=="10.0.5.5") {
xlog("Incomming call from SIP provider2");
$du = "sip:" + "10.0.5.4";
}
# if ($siz=="10.0.5.5") {
# xlog("Incomming call from SIP provider2");
# $du = "sip:" + "10.0.5.4";
# }
# If auth is required perform it
t_on_failure("TRUNKAUTH");
# Relay