Issue
Outbound calls from Twilio’s Voice Android and iOS SDKs consistently fail with error 31408 (Request Timeout). The signaling TLS connection to Twilio’s edge (e.g., chunderm.gll.twilio.com:443) is closed by the server immediately after the TLS handshake. No SIP response is received, no Call SID is created, and nothing appears in the Debugger. The same access tokens work for browser calls using the Voice JS SDK.
Symptoms
- All outbound mobile SDK call attempts fail with error 31408.
- SDK logs show:
RESIP::TRANSPORT: Got TLS SSL_read error=5 ret=0 - No SIP response or Call SID is generated.
- No entries in Twilio Debugger for failed attempts.
- Browser calls using the same access token succeed.
Product
Programmable Voice
Environment
Twilio Console
Cause
Twilio engineering determined that the INVITE request from the mobile SDK was being rejected at the SIP/TCP parsing layer due to a malformed X-Twilio-AccessToken header. Specifically, the access token string passed to the SDK contained a trailing newline character (\n or \r\n). This caused the header to end with LF CR LF instead of the expected CR LF, resulting in a malformed header. The parser treated the rest of the headers and SDP as an invalid body, closed the connection without a SIP response, and no Call SID was created.
Resolution
Trim any trailing newline or whitespace from the access token string before passing it to the Twilio Voice SDK.
- When generating or copying the access token, ensure there are no extra newline or whitespace characters at the end.
- Print or log the access token string before passing it to the SDK to verify its format.
- If a trailing newline is present, remove it (e.g., using
.trim()in your code). - Pass the cleaned token to the SDK.
Once the token is properly formatted, outbound calls from the mobile SDK should connect successfully.
Additional Information
- The same access token works for browser calls because the JS SDK uses WebSocket signaling, not raw SIP over TLS.
- This issue is not related to network, app code, or token validity.
- If you see similar symptoms (connection dropped, no SIP response, error 31408), always check the access token formatting.
Below you will find references to useful documents:
If you continue to experience issues after trimming the access token, please review your SDK logs and contact Twilio Support with detailed log output and timestamps.