URGENT — webhook returned 422; WebSocket/answer ha...
# support
c
Hi Vapi Engineering, This is urgent and needs to be fixed as a permanent change. Problem: Telnyx reports our webhook https://api.vapi.ai/telnyx/inbound_call returned HTTP 422 on a production call (Call Session ID: 04992d02-9ec0-11f0-9583-02420aef32a0, time 2025-10-01 12:13 UTC). Because of that, Telnyx's
answer
to open the bidirectional WebSocket/RTP audio stream failed, and inbound caller audio never reached the assistant. Please perform the following permanent fixes now: 1) Make the
call.initiated
webhook handler return HTTP 200 OK immediately for Telnyx events (do not block Telnyx with synchronous validation). Validate payloads asynchronously instead. 2) Ensure full support for Telnyx's answer` WebSocket audio handshake: - Accept/handle WebSocket audio in bidirectional mode. - Support Opus / 48000 Hz as primary codec and PCMU/8000 as fallback. - Properly map payload types and do correct resampling if needed. 3) Add logging to capture the Telnyx webhook request+response (headers+body) and the answer failure stack trace. 4) Save the first 10–30 seconds of inbound audio that Vapi receives for each failed call for debugging. 5) Confirm format Telnyx will send (WebSocket with
audio/opus
frames or SIP/RTP). If Telnyx uses WebSocket, confirm Vapi’s WebSocket URL and accepted content-types. We need confirmation once these changes are deployed. This is blocking a customer demo. Call Session ID and Telnyx connection ID are included below. Call Session ID: 04992d02-9ec0-11f0-9583-02420aef32a0 Telnyx Connection ID: 2782442782319445746 Webhook URL: https://api.vapi.ai/telnyx/inbound_call Please escalate to engineering and reply ASAP with ETA. Thanks, Constantine.
v
To ensure Telnyx receives an immediate HTTP 200 response and prevent handshake failures, update your webhook handler as follows:
Copy code
js
app.post('/telnyx/inbound_call', (req, res) => {
  res.status(200).send(); // Respond immediately to Telnyx
  // Process and validate payload asynchronously here
});
This pattern avoids blocking Telnyx and allows you to handle validation or logging in the background. For more details, see the [webhook troubleshooting guide](https://docs.vapi.ai/cli/webhook#response-handling). Source: - [Webhook Troubleshooting Guide](https://docs.vapi.ai/cli/webhook#response-handling)
v
Hi Constantine, I can help implement these permanent fixes to ensure Telnyx calls connect reliably and audio reaches the assistant. This includes async webhook validation, full WebSocket audio support with Opus/PCMU handling, detailed logging, and capturing the first 10–30 seconds of inbound audio for debugging. To make sure everything aligns, can you confirm if Telnyx is sending audio/opus frames over WebSocket or using SIP/RTP? Once confirmed, I can prioritize deployment and provide a clear ETA for completion. @Constantine
c
Hi Xcel. Thanks for your response. Telnyx’s log for the failed call (Call Session ID 04992d02-9ec0-11f0-9583-02420aef32a0) shows Telnyx attempted to open a WebSocket audio stream and used PCMU in that attempt. Please do the following as a permanent fix: 1) Support WebSocket audio frames with Opus/48000 as primary codec and PCMU/8000 as fallback. 2) If possible, also accept SIP/RTP media as an alternative mode (some trunks may use SIP/RTP instead of WS). 3) Add robust logging for the WebSocket
answer
step and save the first 10–30s of inbound audio for debugging. 4) Confirm here when deployed and whether you prefer us to force Opus on the Telnyx trunk or let Vapi handle negotiation. If you need, I can ask Telnyx to confirm whether they are sending
audio/opus
frames over WebSocket or only
PCMU
for our trunk. Kindly confirm and give the ETA. This is currently blocking and delaying testing, as well as hindering the use of the AI.
v
Thanks for the detailed info. I’m not part of the standard support team, but I am an expert in Vapi audio integrations and can help implement these permanent fixes, supporting WebSocket with Opus/PCMU, optionally SIP/RTP, adding robust logging, and saving initial inbound audio for debugging. We can also review whether to force Opus on the Telnyx trunk or handle codec negotiation within Vapi. Let’s discuss the details and next steps privately so I can provide an ETA and ensure a smooth deployment. @Constantine
2 Views