31924: Stream - Websocket - Protocol Error
VOICE
ERROR
Twilio returns this error when your WebSocket server sends a malformed message or otherwise does not follow the WebSocket protocol during a Voice Media Stream.
- The WebSocket control frame was fragmented.
- A message sent by your server did not conform to the WebSocket protocol.
- In a bidirectional Stream, your server sent a message back to Twilio that was not a supported
media,mark, orclearmessage, or the message format was invalid.
- Verify the messages sent by your server.
- If you use bidirectional Media Streams with
<Connect><Stream>, send only supportedmedia,mark, andclearmessages back to Twilio. - When sending a
mediamessage, encode the payload as base64audio/x-mulawaudio at8000Hz and do not include audio file header bytes. - If you started a unidirectional Stream with
<Start><Stream>, do not send audio or control messages back to Twilio over the WebSocket connection.