dograh/api/services/telephony/providers/cloudonix
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
..
__init__.py feat: agent stream for cloudonix OPBX (#261) 2026-05-02 15:53:58 +05:30
config.py feat: agent stream for cloudonix OPBX (#261) 2026-05-02 15:53:58 +05:30
provider.py fix: fix inbound for Cloudonix with softphone 2026-05-28 19:49:41 +05:30
routes.py fix(telephony): handle Cloudonix CDR webhooks missing session/disposition (#407) 2026-06-10 17:49:36 +05:30
serializers.py feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
strategies.py feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
transport.py feat: add openai realtime models (#298) 2026-05-16 18:05:23 +05:30