delete ext channel from redis on stasis end

This commit is contained in:
Abhishek Kumar 2026-02-16 16:09:35 +05:30
parent 4bcf10bfae
commit f3b4de9eb6
2 changed files with 5 additions and 4 deletions

View file

@ -95,9 +95,7 @@ class ARIConnection:
async def _mark_ext_channel(self, channel_id: str):
"""Mark a channel as an external media channel we created."""
r = await self._get_redis()
await r.set(
f"{_EXT_CHANNEL_KEY_PREFIX}{channel_id}", "1", ex=_CHANNEL_KEY_TTL
)
await r.set(f"{_EXT_CHANNEL_KEY_PREFIX}{channel_id}", "1", ex=_CHANNEL_KEY_TTL)
async def _is_ext_channel(self, channel_id: str) -> bool:
"""Check if a channel is an external media channel we created."""
@ -239,7 +237,6 @@ class ARIConnection:
f"[ARI org={self.organization_id}] StasisStart for our "
f"externalMedia channel {channel_id}, ignoring"
)
await self._delete_ext_channel(channel_id)
return
app_args = event.get("args", [])
@ -602,6 +599,9 @@ class ARIConnection:
if keys_to_delete:
await self._delete_channel_run(*keys_to_delete)
# Clean up the Redis marker for external channel
await self._delete_ext_channel(ext_channel_id)
logger.info(
f"[ARI org={self.organization_id}] StasisEnd full teardown for "
f"channel={channel_id}, call={call_id}, ext={ext_channel_id}, bridge={bridge_id}"

View file

@ -9,6 +9,7 @@ export const WORKFLOW_RUN_MODES = {
CLOUDONIX: 'cloudonix',
WEBRTC: 'webrtc',
SMALL_WEBRTC: 'smallwebrtc',
ARI: 'ari'
} as const;
export type WorkflowRunMode = typeof WORKFLOW_RUN_MODES[keyof typeof WORKFLOW_RUN_MODES];