Browse Source

reply logs

update-rsyslog-config
lazedo 7 years ago
parent
commit
b64508eca4
1 changed files with 14 additions and 11 deletions
  1. +14
    -11
      kamailio/default.cfg

+ 14
- 11
kamailio/default.cfg View File

@ -727,7 +727,7 @@ route[EXTERNAL_TO_INTERNAL_RELAY]
onreply_route[EXTERNAL_REPLY] onreply_route[EXTERNAL_REPLY]
{ {
xlog("L_INFO", "$ci|log|external reply $T_reply_code\n");
xlog("L_INFO", "$ci|log|external reply $T_reply_code $T_reply_reason\n");
#!ifdef NAT_TRAVERSAL_ROLE #!ifdef NAT_TRAVERSAL_ROLE
if(status=~"[12][0-9][0-9]") { if(status=~"[12][0-9][0-9]") {
@ -755,8 +755,10 @@ onreply_route[EXTERNAL_REPLY]
onreply_route[INTERNAL_REPLY] onreply_route[INTERNAL_REPLY]
{ {
# this route handles replies that are comming from our media server # this route handles replies that are comming from our media server
xlog("L_INFO", "$ci|start|received internal reply $T_reply_code $T_reply_reason\n");
xlog("L_INFO", "$ci|log|source $si:$sp\n");
if ($rs < 300) {
xlog("L_INFO", "$ci|log|internal reply $T_reply_code $T_reply_reason\n");
xlog("L_DEBUG", "$ci|log|source $si:$sp\n");
}
#!ifdef NAT_TRAVERSAL_ROLE #!ifdef NAT_TRAVERSAL_ROLE
if(status=~"[12][0-9][0-9]") { if(status=~"[12][0-9][0-9]") {
@ -828,32 +830,33 @@ failure_route[INTERNAL_FAULT]
# change 6xx to 4xx # change 6xx to 4xx
if (t_check_status("6[0-9][0-9]") && !t_check_status("600|603|604|606")) { if (t_check_status("6[0-9][0-9]") && !t_check_status("600|603|604|606")) {
$var(new_code) = "4" + $(T_reply_code{s.substr,1,0}); $var(new_code) = "4" + $(T_reply_code{s.substr,1,0});
xlog("L_INFO", "$ci|log|sending 6XX reply as $var(new_code) $T_reply_reason\n");
xlog("L_INFO", "$ci|failure|sending $T_reply_code reply as $var(new_code) $T_reply_reason\n");
t_reply("$(var(new_code){s.int})", "$T_reply_reason"); t_reply("$(var(new_code){s.int})", "$T_reply_reason");
# if the failure case was something that we should recover # if the failure case was something that we should recover
# from then try to find a new media server # from then try to find a new media server
} else if ($T_reply_reason =~ "call barred") { } else if ($T_reply_reason =~ "call barred") {
xlog("L_INFO", "$ci|log|failure route ignoring call barred\n");
xlog("L_INFO", "$ci|failure|ignoring call barred\n");
} else if (isflagset(FLAG_SESSION_PROGRESS)) { } else if (isflagset(FLAG_SESSION_PROGRESS)) {
xlog("L_INFO", "$ci|log|failure route ignoring failure after session progress\n");
xlog("L_INFO", "$ci|failure|ignoring failure after session progress\n");
} else if (t_check_status("403") && $T_reply_reason=="Forbidden") { } else if (t_check_status("403") && $T_reply_reason=="Forbidden") {
xlog("L_WARNING", "$ci|log|failure route ignoring. Failed auth from IP $si\n");
xlog("L_WARNING", "$ci|failure|Failed auth from IP $si\n");
} else if (t_check_status("(401)|(407)|(486)")) { } else if (t_check_status("(401)|(407)|(486)")) {
xlog("L_INFO", "$ci|log|failure route ignoring auth reply $T_reply_code $T_reply_reason\n");
xlog("L_INFO", "$ci|failure|auth reply $T_reply_code $T_reply_reason\n");
} else if (t_check_status("402")) { } else if (t_check_status("402")) {
xlog("L_INFO", "$ci|log|failure route overriding reply code 402 with 486\n");
xlog("L_INFO", "$ci|failure|overriding reply code 402 with 486\n");
send_reply("486", "Insufficient Funds"); send_reply("486", "Insufficient Funds");
} else if (t_check_status("(4[0-9][0-9])|(5[0-9][0-9])")) { } 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 $T_reply_reason\n");
xlog("L_INFO", "$ci|failure|internal reply $T_reply_code $T_reply_reason\n");
#!ifdef DISPATCHER_ROLE #!ifdef DISPATCHER_ROLE
route(DISPATCHER_NEXT_ROUTE); route(DISPATCHER_NEXT_ROUTE);
#!endif #!endif
send_reply("486", "Unable to Comply"); send_reply("486", "Unable to Comply");
} else { } else {
xlog("L_INFO", "$ci|log|failure route ignoring reply $T_reply_code $T_reply_reason\n");
xlog("L_INFO", "$ci|failure|internal reply $T_reply_code $T_reply_reason\n");
send_reply("$T_reply_code", "$T_reply_reason"); send_reply("$T_reply_code", "$T_reply_reason");
} }
xlog("L_INFO", "$ci|pass|$si:$sp\n"); xlog("L_INFO", "$ci|pass|$si:$sp\n");


Loading…
Cancel
Save