From 001f55c6b2b8aa3ecf30853d86a64c73b0847c8f Mon Sep 17 00:00:00 2001 From: lazedo Date: Thu, 18 Jun 2020 11:01:53 +0000 Subject: [PATCH] override 480 if call is progress * FLAG_SESSION_PROGRESS is set when the media server sends a 180/183 which is triggered after a route reply. if there are no endpoints to bridge to (dnd, faulty callflow) the return code from the media can be 480 if not set explicitly by callflow action. in that case we were passing it to the incoming leg carrier/endpoint and some carriers retry the call which we don't want. --- kamailio/default.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kamailio/default.cfg b/kamailio/default.cfg index 9c7e537..28bfcc0 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -821,6 +821,10 @@ failure_route[INTERNAL_FAULT] xlog("L_INFO", "$ci|failure|ignoring call barred\n"); } else if (isflagset(FLAG_SESSION_PROGRESS)) { xlog("L_INFO", "$ci|failure|ignoring failure after session progress\n"); + if (t_check_status("480")) { + xlog("L_INFO", "$ci|failure|overriding reply code 480 with 486\n"); + send_reply("486", "Endpoint Not Available"); + } } else if (t_check_status("403") && $T_reply_reason=="Forbidden") { xlog("L_WARNING", "$ci|failure|Failed auth from IP $si\n"); } else if (t_check_status("(401)|(486)")) {