dograh/api/services
Mubashir R a81cccc68b
fix(telephony): handle Cloudonix CDR webhooks missing session/disposition (#407)
* fix(telephony): handle Cloudonix CDR payloads missing session/disposition

The /cloudonix/cdr webhook is a public, unauthenticated endpoint that parses
arbitrary external JSON. It dereferenced cdr_data.get("session").get("token")
unconditionally, so a partial or malformed CDR payload that omits "session"
(or sends "session": null) raised AttributeError -> HTTP 500. The existing
"Missing call_id field" guard right below it was unreachable because the crash
happened first.

StatusCallbackRequest.from_cloudonix_cdr had the same fragility plus a second
one: data.get("disposition", "") returns None when the key is present-but-null,
and None.upper() then crashed.

Navigate both fields defensively so missing/null values fall through to the
intended graceful error path instead of crashing. Adds regression tests
covering missing session, null session, null disposition, and the well-formed
mapping path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: harden cloudonix cdr session validation

* chore: renamed test path

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Sabiha Khan <sabihak89@gmail.com>
2026-06-10 17:49:36 +05:30
..
auth chore: finish renaming UserConfiguration 2026-06-09 16:30:03 +05:30
campaign chore: return formatted transcript url 2026-05-26 13:24:12 +05:30
configuration feat: add Cartesia Sonic 3.5 TTS model (#423) 2026-06-10 15:18:13 +05:30
filesystem chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
gen_ai feat: add Azure AI multi-provider support (TTS, STT, Embeddings, Realtime) (#381) 2026-06-02 12:50:00 +05:30
gender Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
integrations fix timestamps in tuner accumelator (#335) 2026-05-21 07:43:50 +05:30
pipecat feat: add config v2 to simplify billing (#428) 2026-06-09 16:10:26 +05:30
pricing Add Sarvam LLM, update Sarvam STT models, expose usage_info on run detail (#351) 2026-06-01 10:29:31 +05:30
reports chore: return formatted transcript url 2026-05-26 13:24:12 +05:30
telephony fix(telephony): handle Cloudonix CDR webhooks missing session/disposition (#407) 2026-06-10 17:49:36 +05:30
voice_prompting_guide feat: add mcp guides for various topic and stages for bot building (#380) 2026-05-31 16:07:32 +05:30
worker_sync feat: add worker sync events 2026-04-04 14:26:47 +05:30
workflow chore: finish renaming UserConfiguration 2026-06-09 16:30:03 +05:30
mps_service_key_client.py fix: fix service key validation in OSS (#371) 2026-05-28 08:09:35 +05:30
organization_preferences.py feat: add config v2 to simplify billing (#428) 2026-06-09 16:10:26 +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: add config v2 to simplify billing (#428) 2026-06-09 16:10:26 +05:30
storage.py chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
tool_management.py feat: create tools using MCP 2026-05-31 16:50:44 +05:30