31002: Connection declined.
VOICE
ERROR
Error 31002 is a Voice error that means Twilio declined the connection. Use the Debugger to view details about the underlying cause.
- 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 theConnectionDeclinedErrorexception 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.