31005: Connection error
VOICE
ERROR
The WebSocket connection to the Twilio signaling servers closed unexpectedly during the call. If this issue occurs consistently, verify that the provided hostname resolves correctly. If you specify the region parameter during Device setup, ensure that the value is valid.
- DNS or hostname resolution problems for the Twilio signaling endpoint cause the signaling WebSocket to close.
- An invalid
regionvalue in Device setup. - Underlying network conditions can drop or block the WebSocket—for example, DNS failures, restrictive firewalls, the client going offline, or an unreachable Edge.
- Verify that the signaling hostname you provided resolves correctly in your environment.
- If you specify the
regionparameter during Device setup, ensure that the value is valid. In newer SDKs, use a specificedgeinstead of the deprecatedregionparameter. - Confirm that your firewall and network allow outbound TCP port 443 to the Twilio Voice signaling gateways and related endpoints, as documented in the Voice SDKs Network Connectivity Requirements.
- If the WebSocket drops because of a network change, allow the SDK to reconnect. You can also configure
maxCallSignalingTimeoutMsto permit up to 30 seconds of reconnection attempts.