diff --git a/kamailio/default.cfg b/kamailio/default.cfg index fbb548d..ea9d530 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -107,7 +107,8 @@ disable_sctp = yes ####### Modules Section ######## -mpath="/usr/lib64/kamailio/modules/" +# mpath="/usr/lib64/kamailio/modules/" +mpath="/opt/kamailio/lib64/kamailio/modules" ######## Kamailio core extensions module ######## loadmodule "kex.so" @@ -474,7 +475,7 @@ onreply_route[INTERNAL_REPLY] xlog("L_INFO", "$ci|start|recieved internal reply $T_reply_code $rr"); xlog("L_INFO", "$ci|log|source $si:$sp"); - if (t_check_status("180|183")) { + if (t_check_status("(180)|(183)")) { xlog("L_INFO", "$ci|log|session progress, only listening for redirects"); setflag(FLAG_SESSION_PROGRESS); } @@ -483,12 +484,7 @@ onreply_route[INTERNAL_REPLY] xlog("L_INFO", "$ci|pass|$T_req($si):$T_req($sp)"); } - # change 6xx to 4xx - if (t_check_status("6[0-9][0-9]")) { - $var(new_code) = "4" + $(T_reply_code{s.substr,1,0}); - change_reply_status("$var(new_code)", "$rr"); - } - + $var(reply_reason) = $rr; } @@ -522,22 +518,20 @@ failure_route[INTERNAL_FAULT] } } - if (isflagset(FLAG_SESSION_PROGRESS)) { + # change 6xx to 4xx + if (t_check_status("6[0-9][0-9]")) { + $var(new_code) = "4" + $(T_reply_code{s.substr,1,0}); + xlog("L_INFO", "$ci|log|sending 6XX reply as $var(new_code) $var(reply_reason)"); + t_reply("$(var(new_code){s.int})", "$var(reply_reason)"); + } else if ("$var(reply_reason)" =~ "call barred") { + xlog("L_INFO", "$ci|log|failure route ignoring call barred"); + } else if (isflagset(FLAG_SESSION_PROGRESS)) { xlog("L_INFO", "$ci|log|failure route ignoring failure after session progress"); - - exit; - } else if (t_check_status("(401)|(407)|(486)")) { - xlog("L_INFO", "$ci|log|failure route ignoring auth reply $T_reply_code $rr"); - - exit; + } else if (t_check_status("(401)|(407)|(486)|(403)")) { + xlog("L_INFO", "$ci|log|failure route ignoring auth reply $T_reply_code $var(reply_reason)"); } else if (t_check_status("402")) { xlog("L_INFO", "$ci|log|failure route overriding reply code 402 with 486"); - - xlog("L_INFO", "$ci|pass|$si:$sp"); - send_reply("486", "Insufficient Funds"); - - exit; } else if (t_check_status("(4[0-9][0-9])|(5[0-9][0-9])")) { xlog("L_INFO", "$ci|start|received failure reply $T_reply_code $rr"); @@ -546,13 +540,10 @@ failure_route[INTERNAL_FAULT] #!endif send_reply("486", "Unable to Comply"); - - exit; } else { xlog("L_INFO", "$ci|log|failure route ignoring reply $T_reply_code $rr"); - - exit; } + xlog("L_INFO", "$ci|pass|$si:$sp"); } onsend_route {