admin管理员组

文章数量:1431949

I keep getting error code 31002 in Twilio without know how to debug. I use client JS and Ruby on Rails as my backend.

First of all, what I'm going to do is to create apps that can make voice call from my browser to mobile phone.

Please see image below for the error I got on my browser:

I keep getting error code 31002 in Twilio without know how to debug. I use client JS and Ruby on Rails as my backend.

First of all, what I'm going to do is to create apps that can make voice call from my browser to mobile phone.

Please see image below for the error I got on my browser:

Share Improve this question edited Mar 24, 2018 at 23:14 halfer 20.4k19 gold badges109 silver badges202 bronze badges asked Mar 23, 2018 at 16:05 Aizuddin BadryAizuddin Badry 4643 gold badges9 silver badges22 bronze badges 4
  • 31002? i dont see that error code twilio./docs/api/voice-sdk/error-codes – Muhammad Omer Aslam Commented Mar 23, 2018 at 16:09
  • The error codes e from client itself. Can read the error codes here twilio./docs/api/client/errors it said "Connection declined. Check the debugger for more information on the actual cause." but i cannot find any actual cause @MuhammadOmerAslam – Aizuddin Badry Commented Mar 23, 2018 at 16:13
  • it tells you to look into the details field for more information on the error 31002 : A required parameter was not passed with the request. The error object's detail field will provide more information as to what field was missing. – Muhammad Omer Aslam Commented Mar 23, 2018 at 19:19
  • I think readers will need to see more information to understand what's wrong here (indeed, error messages should be posted as text, not images - could you edit?). – halfer Commented Mar 24, 2018 at 23:14
Add a ment  | 

2 Answers 2

Reset to default 5

The 31002 error code is returned by Twilio API. Here are some troubleshooting steps to rule out basic errors:

  1. Check the debugger page on your Twilio console https://www.twilio./console/runtime/debugger. If you don't see the call in the log, it's likely that you are looking at the wrong Twilio account/subaccount/project. Project is on the left of the top action bar, subaccount is on the right.

  2. Go to the console dashboard https://www.twilio./console, check if your application is using the correct TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN

  3. Go to Programmable voice https://www.twilio./console/voice/twiml/apps, check if you are using the correct application SID
  4. Go to Phone numbers https://www.twilio./console/phone-numbers/ining, check if you are using the right number.

My experience, the rule of thumb is, if you don't see any activity on the Twilio debugger page, you are probably using the wrong SID/token/etc.

I faced this error before, because I used wrong webhook url.

In this case, twilio can't find your backend and the outgoing call fails.

Hope this help you.

本文标签: javascriptTwilio Outgoing Calls Failed Code 31002Stack Overflow