dograh/api/services/telephony/providers
Sabiha Khan 085ab0a7ae
fix: honor telnyxs per-call codec in bidirectional stream (#256)
Telnyx's bidirectional stream uses different codecs per direction:
  - Dograh → Telnyx: what we declare via `stream_bidirectional_codec`
  - Telnyx → Dograh: whatever the PSTN leg negotiated (PCMA for UK,
    Europe, India termination; PCMU for US), announced as
    `media_format.encoding` on the WebSocket start message.

We hardcoded both directions on the serializer to PCMU, so any call
whose PSTN leg used PCMA arrived as A-law bytes that we decoded
through a μ-law table → static for the entire call.

`handle_websocket` now extracts `media_format.encoding` from the
start message and threads it through `transport_kwargs`. The
serializer uses it for the Telnyx → Dograh direction; the
Dograh → Telnyx direction stays pinned to PCMU to match the
unchanged `stream_bidirectional_codec` in the dial/answer payloads.

Note: pipecat's `TelnyxFrameSerializer` names its params from the
call's POV, not Dograh's — `inbound_encoding` is what we send into
the call, `outbound_encoding` is what we receive. Easy to mix up.
2026-04-29 19:20:52 +05:30
..
ari feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
cloudonix feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
plivo feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
telnyx fix: honor telnyxs per-call codec in bidirectional stream (#256) 2026-04-29 19:20:52 +05:30
twilio feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
vobiz feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
vonage feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
__init__.py feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
CLAUDE.md feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30