From 87fd001ebd0eab972da2cdeef6d5bb394e6bac5d Mon Sep 17 00:00:00 2001 From: sergey-safarov Date: Sun, 21 May 2017 07:20:19 -0400 Subject: [PATCH] Added IP address logging for failed auth (#168) --- kamailio/default.cfg | 2 ++ kamailio/registrar-role.cfg | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index 7a677af..f1b3234 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -781,6 +781,8 @@ failure_route[INTERNAL_FAULT] xlog("L_INFO", "$ci|log|failure route ignoring call barred\n"); } else if (isflagset(FLAG_SESSION_PROGRESS)) { xlog("L_INFO", "$ci|log|failure route ignoring failure after session progress\n"); + } else if (t_check_status("403") && $var(reply_reason)=="Forbidden") { + xlog("L_WARNING", "$ci|log|failure route ignoring. Failed auth from IP $si\n"); } 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)\n"); } else if (t_check_status("402")) { diff --git a/kamailio/registrar-role.cfg b/kamailio/registrar-role.cfg index 2100844..8917147 100644 --- a/kamailio/registrar-role.cfg +++ b/kamailio/registrar-role.cfg @@ -207,7 +207,7 @@ route[CHECK_AUTHORIZATION] #!endif auth_challenge("$fd", "0"); - xlog("L_INFO", "$ci|end|issued auth challenge to failed registration attempt for $Au $si:$sp\n"); + xlog("L_WARNING", "$ci|end|issued auth challenge to failed registration attempt for $Au from IP $si:$sp\n"); exit; }