# 31002: Connection declined.

Log Type: TWILIO

Log Level: ERROR

## Description

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

### Possible causes

* 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.

### Possible solutions

* 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

* [Voice JavaScript SDK: Changelog](/docs/voice/sdks/javascript/changelog)
* [TwiML Voice: \<Reject>](/docs/voice/twiml/reject)
* [Voice JavaScript SDK: Twilio.Call](/docs/voice/sdks/javascript/twiliocall)
