diff --git a/services/asterisk_bridge_service/voice_ai.py b/services/asterisk_bridge_service/voice_ai.py index 1eed1a8..393b3ab 100644 --- a/services/asterisk_bridge_service/voice_ai.py +++ b/services/asterisk_bridge_service/voice_ai.py @@ -938,7 +938,11 @@ def retry_escalation_no_answer(session, *, call_id: str, dial_outcome: str) -> N ) attempted_ids = json.loads(escalation.attempted_agent_ids_json or "[]") - channel = _resolve_handoff_channel(session, link) + # Use the already-known, actively-maintained channel name directly instead of + # _resolve_handoff_channel()'s live AMI CoreShowChannels re-discovery: that + # round-trip can take ~10s, which races (and loses) against the dialplan's + # own short MusicOnHold-then-hangup wait window for this exact retry path. + channel = str(link.channel_name or "").strip() or _resolve_handoff_channel(session, link) required_skills = json.loads(escalation.required_skills_json or "[]") next_agent = _reserve_routing_agent( call_id=call_id, diff --git a/services/shared/models.py b/services/shared/models.py index 00b2bd9..4c8f470 100644 --- a/services/shared/models.py +++ b/services/shared/models.py @@ -363,6 +363,12 @@ class VoiceEventIn(BaseModel): "recording.ready", "call.connected", "call.transferred", + "AgentReserved", + "AgentRinging", + "AgentNoAnswer", + "AgentConnected", + "TransferCompleted", + "TransferFailed", ] call_id: str interaction_id: str | None = None