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

31002: Connection declined.


ERROR: 31002

error-31002 page anchor
VOICE
ERROR

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