Symptom
Users experience intermittent WebSocket disconnections when utilizing the Vonage Voice API. The disconnections occur both in local environments and when deployed in cloud environments, varying in time from about 30 seconds to 3 minutes into the call. The issue persists even with different SDK versions.
Applies To
- Vonage Voice API
- Deployment environments: Local and Cloud
Resolution
- Try a lower bitrate audio codec, such as
audio/l16;rate=8000
instead ofaudio/l16;rate=16000
. - Send audio in smaller chunks if possible.
- Check server and load balancer logs for additional clues about the disconnections.
- Each message needs to be a 20ms sample of audio. At 8kHz the message should be 320 bytes. At 16kHz the message should be 640 bytes.
Cause
This issue can happen due to incorrect handling of audio throughput settings. Audio chunks configured as too large for the specified bitrate can cause disconnections.
Additional Information
For specific guidance on managing audio settings and WebSocket connections in Vonage APIs, refer to the Vonage API Developer Documentation on WebSockets.
Articles in this section
- Why is there an extended silence at the beginning of a call and how can it be reduced?
- Intermittent WebSocket Disconnections
- What Is An NCCO
- How Does Jitter Impact Voice Calls
- Voice API "Bad Request" Error When Ending Calls Immediately After Creation
- What Is MOS Score In Voice Calls?
- Is there a way to see current active calls on our account?
- How To Make MP3 of Recording From Voice API in Python
- How To Enter DTMF Before MP3 Stream Finishes
- Can a user call leg be removed from the voice call recording?