Skip to main content

WebSocket Connection Issues

Connection Fails to Establish

Connection Drops Mid-Call


Audio Quality Issues

No Audio Received

  1. Verify audioTrack setting - Ensure it’s set to both or inbound in your Stream XML
  2. Check WebSocket handler - Confirm your onMedia handler is registered before calling start()
  3. Verify call is connected - The start event should fire before any media events

No Audio Playback to Caller

  1. Verify bidirectional mode - Ensure bidirectional="true" in your Stream XML
  2. Check content type match - The contentType and sampleRate in your playAudio message must match your Stream XML settings
  3. Verify audio format - Send raw audio data only (no WAV headers)

Distorted or Garbled Audio


Performance Issues

High Latency

Slow Response Times

  1. Use μ-law 8kHz - Native telephony format requires no transcoding
  2. Deploy regionally - Place your WebSocket server near your caller locations
  3. Stream audio - Send TTS audio as it’s generated, don’t wait for completion
  4. Connection pooling - Reuse AI service connections

Status Callback Events

Monitor your statusCallbackUrl for stream lifecycle events:

DroppedStream Reasons

  • WebSocket connection failed during initiation
  • WebSocket connection terminated during streaming
  • WebSocket connection terminated due to slow connection

Debug Logs

Access audio stream logs in the Plivo Console:
  1. Go to VoiceLogsCalls
  2. Click on the call to view details
  3. Find the Audio Streams section with:
    • Stream UUID
    • Start/end times
    • Duration and billing
    • Hangup reason
    • Debug logs link

Sample Debug Log


Common Error Messages