Menu

Expand
Rate this page:

Twilio Client JS SDK: Troubleshooting & Common Errors

You’re viewing the 1.X version of the Voice JavaScript SDK (formerly called Twilio Client). Click here for information on how to migrate to the 2.X version.

DSCP Support

Due to a breaking change introduced in Chrome 72, SDK versions prior to 1.6.10 will no longer enable DSCP. For DSCP support, please update to the newest version of the SDK.

Common Errors

Following are the common errors encountered in twilio.js, what they mean, and our troubleshooting recommendations.

Error text: 31201 Error while accessing microphone

Where: This error is a result of a getUserMedia failure, usually in response to calling device.connect() or connection.accept().

Details: The user granted permission, but there was an issue getting the media. The user may need to try another input device, or troubleshoot their hardware. The failure will correspond to one of the many getUserMedia exceptions listed here. The most common issue is the NotFoundError which indicates the device ID passed to Device.audio.setInputDevice() was not found.

Error text: 31208 Permission Denied

Where: This error is a result of a getUserMedia failure, usually in response to calling device.connect() or connection.accept().

Details: Received when the user denies permission to the microphone. The user won’t have an input audio track, and should be asked to refresh and grant permission.

Error text: 31205 Token Expired

Where: This error will be emitted via device.on('error') when a token expires, and will throw to console if uncaught.

Details: The access token has expired. The signaling channel, DTMF and Insights will stop working until a new token is provided via Device.setup(token). The application should create a new token and replace it before the prior token expires.

Error text: 31003 ICE negotiation failed

Where: This error will be emitted via connection.on('error') during connecting, shortly after device.connect() or connection.accept().

Details: The ICE negotiation couldn’t find any acceptable candidates, or otherwise failed to connect. The end user may want to try again; if failures continue, there's likely a network issue, such as firewall, preventing connectivity.

Error text: 31003 Connection interrupted

Where: This error will be emitted via connection.on('error') during an established and active call.

Details: The ICE status changed from connected to failed. As of 1.6.5, this automatically disconnects the connection, however in a future update Twilio will attempt to re-establish the ICE connection.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more