From 8f10bcade32079af126e4e9d83061cd30936fcad Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 29 May 2026 17:07:58 +0000 Subject: [PATCH] fix: store channel id in gathered context for ARI outbound --- api/services/telephony/ari_manager.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/services/telephony/ari_manager.py b/api/services/telephony/ari_manager.py index a9537ba..a10c05d 100644 --- a/api/services/telephony/ari_manager.py +++ b/api/services/telephony/ari_manager.py @@ -657,9 +657,17 @@ class ARIConnection: await self._mark_ext_channel(ext_channel_id) await self._set_channel_run(ext_channel_id, workflow_run_id) await self._set_pending_bridge(ext_channel_id, channel_id, workflow_run_id) + # Persist the caller channel id as call_id. Inbound runs already + # set this in create_workflow_run, but outbound runs never do, so + # without this the serializer hangup (provider reads + # gathered_context["call_id"]) and the StasisEnd teardown both get + # an empty channel id and fail to hang up the live caller channel. await db_client.update_workflow_run( run_id=int(workflow_run_id), - gathered_context={"ext_channel_id": ext_channel_id}, + gathered_context={ + "ext_channel_id": ext_channel_id, + "call_id": channel_id, + }, ) # 3. Create the ext media channel with the id we just registered.