dograh/api/services
Sabiha Khan ebeffdbc40
fix(ari): pre-register ext channel id and defer bridge to its StasisS… (#284)
* fix(ari): pre-register ext channel id and defer bridge to its StasisStart

Two race conditions in the inbound ARI flow could leave a call silent:

1. Bridging both channels immediately after creating the ext media leg
   raced against the ext channel entering the Stasis application; slow
   chan_websocket handshakes produced "Channel not in Stasis application"
   422 errors on addChannel.

2. Asterisk could fire StasisStart for the ext channel before the
   externalMedia POST response returned, so _is_ext_channel returned
   False and the event was dropped as an unknown outbound call.

Fixes:
- Generate the ext channel id as dograh-ext-<uuid> client-side and pass
  it to Asterisk via the channelId query param. Mark the ext channel,
  set its channel->run mapping, register the pending bridge entry, and
  persist gathered_context.ext_channel_id all before the POST.
- Defer the bridge to a new _complete_bridge_after_ext_ready handler
  triggered by the ext channel's own StasisStart. Both channels are
  guaranteed in Stasis by then, so addChannel cannot 422.
- On POST failure or channelId mismatch, roll back the pending entry
  and ERROR loudly.

* fix: replace in-memory dict with redis storage
2026-05-13 18:33:34 +05:30
..
auth feat: add test mode for API trigger 2026-04-25 16:30:26 +05:30
campaign fix: number pool initialization in multi telephony setup 2026-05-08 14:48:53 +05:30
configuration feat: configurable ElevenLabs base URL for Data Residency (#278) 2026-05-12 19:01:13 +05:30
filesystem chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
gen_ai feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
gender Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
integrations Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
looptalk feat: add workflow graph constraints fixtures 2026-05-08 16:02:51 +05:30
pipecat feat: configurable ElevenLabs base URL for Data Residency (#278) 2026-05-12 19:01:13 +05:30
pricing feat: add qa node in workflow builder (#172) 2026-02-25 13:53:30 +05:30
reports fix: number pool initialization in multi telephony setup 2026-05-08 14:48:53 +05:30
smart_turn feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
telephony fix(ari): pre-register ext channel id and defer bridge to its StasisS… (#284) 2026-05-13 18:33:34 +05:30
worker_sync feat: add worker sync events 2026-04-04 14:26:47 +05:30
workflow fix: prior pre-pr drift check failures (#276) 2026-05-12 14:17:40 +05:30
mps_service_key_client.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
posthog_client.py feat: add posthog signup and signin events, enable backend posthog events for oss version (#249) 2026-04-24 12:02:52 +05:30
quota_service.py feat: enable FORCE_TURN_RELAY to diagnose turn connectivity for local deployment setups (#272) 2026-05-11 17:13:01 +05:30
storage.py chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30