Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the

31005: Connection error


ERROR: 31005

error-31005 page anchor
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.

Possible Causes

possible-causes page anchor
  • DNS or hostname resolution problems for the Twilio signaling endpoint cause the signaling WebSocket to close.
  • An invalid region value 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 region parameter during Device setup, ensure that the value is valid. In newer SDKs, use a specific edge instead of the deprecated region parameter.
  • 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 maxCallSignalingTimeoutMs to permit up to 30 seconds of reconnection attempts.

Additional resources

additional-resources page anchor