← Back to PRs

#7652: fix(voice-call): fix Telnyx transcription (STT) not working

by tturnerdev open 2026-02-03 02:52 View on GitHub →
channel: voice-call
## Problem Telnyx Call Control transcription was not working because: 1. **Wrong field mapping**: The code expected transcription text in `payload.transcription`, but Telnyx actually sends it in `payload.transcription_data.transcript` 2. **Missing required parameter**: The `transcription_start` API call was missing the required `transcription_engine` parameter ## Root Cause Telnyx `call.transcription` webhook events have this structure: ```json { "payload": { "transcription_data": { "is_final": true, "transcript": "Hello, this is the transcribed text", "transcription_track": "inbound" } } } ``` But the code was looking for: ```json { "payload": { "transcription": "...", "is_final": true } } ``` ## Solution 1. Updated `normalizeEvent()` to extract transcript from `transcription_data.transcript` with fallback to legacy format 2. Added `transcription_engine: "Telnyx"` to `transcription_start` API call 3. Added proper TypeScript interface for `TelnyxTranscriptionData` ## Files Changed - `extensions/voice-call/src/providers/telnyx.ts` ## Testing - [x] `transcription_start` API call succeeds - [x] `call.transcription` webhook events are parsed correctly - [x] Transcript text is extracted properly - [x] Multi-turn conversations work end-to-end ## Backwards Compatibility The fix uses fallback values to maintain compatibility: ```typescript transcript: data.payload?.transcription_data?.transcript || data.payload?.transcription || "" ``` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the Telnyx voice-call provider to restore STT transcription by (1) normalizing `call.transcription` webhook events from Telnyx’s nested `payload.transcription_data.*` fields (with fallback to the prior flat fields) and (2) adding the required `transcription_engine` parameter when invoking the `transcription_start` call-control command. The changes are localized to `extensions/voice-call/src/providers/telnyx.ts`, where `parseWebhookEvent()` converts Telnyx webhooks into the internal `NormalizedEvent` shape used by the voice-call manager; the corrected mapping ensures downstream `call.speech` events contain a non-empty transcript when Telnyx sends the documented payload shape. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk; it’s a targeted fix that aligns Telnyx webhook parsing and API usage with the documented payload/parameters. - Reviewed the only changed file and its integration points: the updated normalization maps Telnyx’s nested `transcription_data` into the existing `call.speech` normalized event shape while preserving backward compatibility via fallbacks. Adding `transcription_engine` to `transcription_start` matches the documented requirement and should only improve behavior. No new control flow paths or side effects beyond improved parsing/request payloads were introduced. - No files require special attention <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs