dograh/api
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
..
alembic feat: add logs in campaigns for failure or pausing (#265) 2026-05-05 19:23:50 +05:30
assets feat: telephony call transfer (#155) 2026-02-16 14:33:33 +05:30
db feat: add telnyx webhook api key in telephony config (#270) 2026-05-09 18:03:42 +05:30
errors Feat/inbound telephony (#113) 2026-01-12 10:10:30 +05:30
mcp_server feat: add workflow graph constraints fixtures 2026-05-08 16:02:51 +05:30
native/rnnoise Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
routes feat: enable FORCE_TURN_RELAY to diagnose turn connectivity for local deployment setups (#272) 2026-05-11 17:13:01 +05:30
schemas feat: agent stream for cloudonix OPBX (#261) 2026-05-02 15:53:58 +05:30
services fix(ari): pre-register ext channel id and defer bridge to its StasisS… (#284) 2026-05-13 18:33:34 +05:30
tasks chore: add campaign id in render context for webhook 2026-05-12 19:32:41 +05:30
tests feat: verify telnyx webhook signature optionally (#279) 2026-05-12 19:47:28 +05:30
utils feat: add workflow graph constraints fixtures 2026-05-08 16:02:51 +05:30
.cursorignore Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
.dockerignore Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
.env.example fix: number pool initialization in multi telephony setup 2026-05-08 14:48:53 +05:30
.gitignore Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
__init__.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
AGENTS.md feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
alembic.ini chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
app.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
CLAUDE.md Chore/add setup and contributing docs (#90) 2025-12-27 09:25:20 +05:30
conftest.py chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
constants.py feat: verify telnyx webhook signature optionally (#279) 2026-05-12 19:47:28 +05:30
Dockerfile chore: update dev scripts and documentation 2026-05-12 13:54:33 +05:30
enums.py feat: add Plivo telephony provider support (#245) 2026-04-25 20:41:46 +05:30
logging_config.py feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
pyproject.toml chore(main): release dograh 1.28.0 (#266) 2026-05-11 17:15:03 +05:30
pytest.ini feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
requirements.dev.txt feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
requirements.txt Verify Telnyx webhook signatures (#271) 2026-05-12 18:37:31 +05:30
sdk_expose.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30