Sms from twilio is not arriving. so any body help reslove it

Your ‘From’ phone number is not valid, you dont need to put your phone number there. ==You have to put the one provided by twillio.

when you try to run the program , the Error-21606 occured from the twilio end , here is the explanation of the Error:
“You are attempting to use a “From” number which is not capable of sending SMS messages to your “To” number. Two common reasons for this: You might be trying to send SMS from a phone number which is only enabled for voice. … All other Twilio phone numbers are not capable of sending SMS messages.”
try to check the details of conf.py file while importing in another file.


I have entered correctly but the error is occurring what shall I do

Now what is the changed error, please post that too.

the number is capable of sending SMS I checked out from the website

@varshathgupta Make sure that you verify your “TO_NUMBER”.

@varshathgupta

Can you please share the code that you are executing?

@varshathgupta
Check my code It may help you.

ubuntu@ip-172-31-43-243:~$ cat sms.py
import conf, json, time, math, statistics
from boltiot import Sms, Email, Bolt
sms = Sms(conf.SSID,conf.AUTH_TOKEN,conf.TO_NUMBER,conf.FROM_NUMBER)
print (“Test SMS Sending”)
response = sms.send_sms(“Alert! Someone has opened the fridge door”)
print(“Response:”,response)
ubuntu@ip-172-31-43-243:~$ python3 sms.py
Test SMS Sending
Response: <Twilio.Api.V2010.MessageInstance account_sid=AC03bd03b288a5e2ca79f5d0b25e6eadb3 sid=SMf2dc3be1d270468bb7020bca59b9f8a3>
ubuntu@ip-172-31-43-243:~$

yup, i think the error is not of twilio anymore and there is some problem parsing json package. Can you please post both of your codes so that i can check.

I have verified my “TO_NUMBER” in that website


Sure i will try your code.

hey @varshathgupta replace your sms line with"sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)"parameter which are to be passed should be in a correct manner.In your code you’ve passed conf.FROM_NUMBER before conf.TO_NUBMER which is incorrect.
I hope this will help you.

1 Like

thanks for the solution. I got output now.

@varshathgupta your welcome😊.