working options and failover with and without probe
This commit is contained in:
28
kamailio.cfg
28
kamailio.cfg
@@ -5,7 +5,7 @@ loadmodule "rr.so"
|
|||||||
loadmodule "maxfwd.so"
|
loadmodule "maxfwd.so"
|
||||||
loadmodule "textops.so"
|
loadmodule "textops.so"
|
||||||
loadmodule "rtpengine.so"
|
loadmodule "rtpengine.so"
|
||||||
#loadmodule "dispatcher.so"
|
loadmodule "dispatcher.so"
|
||||||
loadmodule "nathelper.so"
|
loadmodule "nathelper.so"
|
||||||
loadmodule "ctl"
|
loadmodule "ctl"
|
||||||
loadmodule "pv"
|
loadmodule "pv"
|
||||||
@@ -25,9 +25,9 @@ log_facility=LOG_LOCAL0
|
|||||||
# RTPProxy settings
|
# RTPProxy settings
|
||||||
modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
|
modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
|
||||||
# Dispatcher settings
|
# 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_interval", 10)
|
||||||
#modparam("dispatcher", "ds_ping_method", "OPTIONS")
|
#modparam("dispatcher", "ds_ping_method", "REGISTER")
|
||||||
#modparam("dispatcher", "ds_probing_threshold", 10)
|
#modparam("dispatcher", "ds_probing_threshold", 10)
|
||||||
#modparam("dispatcher", "ds_inactive_threshold", 10)
|
#modparam("dispatcher", "ds_inactive_threshold", 10)
|
||||||
#modparam("dispatcher", "ds_ping_latency_stats", 1)
|
#modparam("dispatcher", "ds_ping_latency_stats", 1)
|
||||||
@@ -45,10 +45,16 @@ modparam("uac","auth_realm_avp","$avp(arealm)")
|
|||||||
# TM settings
|
# TM settings
|
||||||
modparam("tm", "auto_inv_100_reason", "Trying")
|
modparam("tm", "auto_inv_100_reason", "Trying")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Main SIP request routing logic
|
/* Main SIP request routing logic
|
||||||
* - processing of any incoming SIP request starts with this route
|
* - processing of any incoming SIP request starts with this route
|
||||||
* - note: this is the same as route { ... } */
|
* - note: this is the same as route { ... } */
|
||||||
request_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
|
# per request initial checks
|
||||||
route(REQINIT);
|
route(REQINIT);
|
||||||
|
|
||||||
@@ -110,17 +116,19 @@ route[RELAY] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# update $du to set the destination address for proxying based on caller IP
|
# 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");
|
xlog("Incomming call from SIP provider");
|
||||||
$du = "sip:" + "10.0.5.4";
|
# $du = "sip:" + "10.0.5.4";
|
||||||
|
$du = "sip:" + $avp(customerpbxip);
|
||||||
} else {
|
} else {
|
||||||
xlog("Incomming call from Customer PBX");
|
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") {
|
# if ($siz=="10.0.5.5") {
|
||||||
xlog("Incomming call from SIP provider2");
|
# xlog("Incomming call from SIP provider2");
|
||||||
$du = "sip:" + "10.0.5.4";
|
# $du = "sip:" + "10.0.5.4";
|
||||||
}
|
# }
|
||||||
# If auth is required perform it
|
# If auth is required perform it
|
||||||
t_on_failure("TRUNKAUTH");
|
t_on_failure("TRUNKAUTH");
|
||||||
# Relay
|
# Relay
|
||||||
|
|||||||
Reference in New Issue
Block a user