Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this pageProducts used
Looking for more inspiration?Visit the
Error
Twilio error

31002: Connection declined.

Twilio Voice DocumentationVoice

Description

description page anchor

Error 31002 is a Voice error that means Twilio declined the connection. Use the Debugger to view details about the underlying cause.

Possible causes

possible-causes page anchor
  • The called party or application rejected the incoming call—for example, by calling call.reject() in the Voice JavaScript SDK or by returning TwiML that uses the <Reject> verb.
  • The call was declined at the signaling layer and surfaced to the SDK as a declined connection. Twilio Voice SDKs document a decline as a SIP server error with code 31603, and the JavaScript SDK maps the ConnectionDeclinedError exception to error 31002.
  • Use the Twilio Debugger to inspect the event details and any linked error codes to determine why the connection was declined.
  • If your client app unintentionally rejects calls, update the logic to accept incoming calls and avoid calling call.reject() unless the user explicitly declines.
  • If your server application is returning <Reject>, remove or adjust that TwiML so legitimate calls are accepted.
  • For the Voice JavaScript SDK, consider enabling improved signaling error precision and update your error handling to recognize 31002 for declined connections instead of generic errors.

Additional resources

additional-resources page anchor