From 8382dfa9ba4aaf702912542d7fe5e17c6b68ef6e Mon Sep 17 00:00:00 2001 From: arys Date: Mon, 31 Aug 2026 00:43:20 +0500 Subject: [PATCH] fix: treat AST_CAUSE no-route/unallocated as a no-answer retry outcome process_agent_dial_outcome only recognized hangup causes 17/18/19/21/34/38. When the reserved agent's AOR has zero registered contacts (e.g. the softphone dropped, or nobody ever registered), Asterisk immediately hangs up with cause 3 (no route to destination) instead of running a Dial() long enough to produce a DialEnd/NOANSWER at all - so the retry listener silently ignored it and the escalation was left dangling in 'ringing' status (the agent itself still got released via the call-ended fallback path, but no retry to the next agent was ever attempted and the escalation record never reflects the failure). Added causes 1 (unallocated number), 3 (no route), 20 (subscriber absent), 22 (number changed) alongside the existing set. --- services/asterisk_bridge_service/bridge_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/asterisk_bridge_service/bridge_processing.py b/services/asterisk_bridge_service/bridge_processing.py index 14d4b19..ca3a7ae 100644 --- a/services/asterisk_bridge_service/bridge_processing.py +++ b/services/asterisk_bridge_service/bridge_processing.py @@ -1233,7 +1233,7 @@ def process_recording_ready( _NO_ANSWER_DIAL_STATUSES = {"NOANSWER", "BUSY", "CANCEL", "CHANUNAVAIL", "CONGESTION"} -_NO_ANSWER_HANGUP_CAUSES = {"17", "18", "19", "21", "34", "38"} +_NO_ANSWER_HANGUP_CAUSES = {"1", "3", "17", "18", "19", "20", "21", "22", "34", "38"} def process_agent_dial_outcome(session, row: AsteriskEventLogRow, payload: dict[str, Any]) -> None: -- 2.54.0