Code cleanup and regression tests ok!
This commit is contained in:
19
kamailio.cfg
19
kamailio.cfg
@@ -19,6 +19,11 @@ loadmodule "sanity"
|
|||||||
loadmodule "acc.so"
|
loadmodule "acc.so"
|
||||||
loadmodule "dialog.so"
|
loadmodule "dialog.so"
|
||||||
|
|
||||||
|
|
||||||
|
# Lines to configure:
|
||||||
|
# uac reg_contact_addr
|
||||||
|
# 3 avps
|
||||||
|
|
||||||
# Global parameters
|
# Global parameters
|
||||||
cfgengine "native"
|
cfgengine "native"
|
||||||
fork=yes
|
fork=yes
|
||||||
@@ -133,23 +138,13 @@ 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==$avp(sip1) || $siz==$avp(sip2)) {
|
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:" + $avp(customerpbxip);
|
$du = "sip:" + $avp(customerpbxip);
|
||||||
} else {
|
} else {
|
||||||
xlog("Incomming call from Customer PBX");
|
xlog("Incomming call from Customer PBX");
|
||||||
# $du = "sip:" + "10.0.5.7";
|
|
||||||
ds_select_dst("1","9");
|
ds_select_dst("1","9");
|
||||||
}
|
}
|
||||||
# if ($siz=="10.0.5.5") {
|
|
||||||
# xlog("Incomming call from SIP provider2");
|
|
||||||
# $du = "sip:" + "10.0.5.4";
|
|
||||||
# }
|
|
||||||
# Start CDR
|
|
||||||
setflag(2);
|
|
||||||
# If auth is required perform it
|
# If auth is required perform it
|
||||||
t_on_failure("TRUNKAUTH");
|
t_on_failure("TRUNKAUTH");
|
||||||
# Start CDR
|
|
||||||
setflag(1);
|
|
||||||
# Relay
|
# Relay
|
||||||
t_relay();
|
t_relay();
|
||||||
exit;
|
exit;
|
||||||
@@ -157,17 +152,13 @@ route[RELAY] {
|
|||||||
|
|
||||||
# TRUNK AUTH ROUTE
|
# TRUNK AUTH ROUTE
|
||||||
failure_route[TRUNKAUTH] {
|
failure_route[TRUNKAUTH] {
|
||||||
xlog("trunk auth");
|
|
||||||
if (t_is_canceled()) {
|
if (t_is_canceled()) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
xlog("Checking status code");
|
|
||||||
if(t_check_status("401|407")) {
|
if(t_check_status("401|407")) {
|
||||||
xlog("status code is valid auth challenge");
|
|
||||||
$avp(auser) = "kam";
|
$avp(auser) = "kam";
|
||||||
$avp(apass) = "kam";
|
$avp(apass) = "kam";
|
||||||
uac_auth();
|
uac_auth();
|
||||||
xlog("after uac_auth");
|
|
||||||
t_relay();
|
t_relay();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user