Twilio SMS Always Shows as Delivered - twilio

I am testing the SMS message status log in Twilio (python), but I'm finding that all statuses report as "delivered", even if the receiving device is turned off. Are only particular carriers able to confirm delivery to the handset? Or am I pulling the wrong status?
message = client.messages.create(
body="Phone off!",
to="97.....",
from_="97.....",
)
resources = client.messages.list()
for resource in resources:
print resource.to, resource.status

Twilio evangelist here.
The Delivered status indicates that we have received a delivery receipt from the upstream carrier. If the carrier reports it to us, we should show messages that were delivered to powered off handsets as undelivered. Not all carriers return the same data so its possible that the specific carrier you are sending the message is not returning the powered-off state to us. I'd suggest shooting an email to help#twilio.com and they can work with you to determine what details your specific carrier is returning to Twilio.
Hope that helps.

Related

WhatsApp chats real time recording

I have requirement from compilance to backup my business WA users chats (for reasonable price...)
Ive googled a lot and seems (correct me if Im wrong) only solution is to build own chat app (or use app delivered by API provider)
I've checked eg twilio, 360dialog, chat-api
I played a bit witch twilio and I know how to save incoming messages (sent by eg client), but not outgoing (sent by my users)
Also I know how to send WA msgs from my own app (so I can record those)
But my preference would be users to use WA on mobile phones or WA web and listen some hooks to record that.
Any idea how to implement that? Maybe WA buisness API can do that?
There is no straight way to do this using WhatsApp Business APIs,
You need to record both the messages in one place/table/collection whether it is sent from our business phone number or received from the clients/users.
We can do it but have to use proper logic, let's see both the scenario and how to record it in one place/table/collection,
Send Message from WhatsApp Business API (from our business phone number) to clients/users:
You can record the message whenever Business sends any message to clients/users because Webhook does not give that sent message content, yes it will notify us about status updates like sent, delivered, read, failed, etc.
Things we can record:
Message ID (This is important, you will get in response whenever we send a message from Business API)
From Phone Number (Business phone number)
Message Content
To Phone Number (Client/user phone number)
Message Status (sent, read, delivered, failed)
Sent Date
Updated Date (updated message status date)
Type (from business)
Receive Messages from clients/users to our Business Phone Number:
You can get message content from Webhook, so we can record that received message content object in our table/collection,
Things we can record:
Message ID (This is important, Get in Webhook)
From Phone Number (Client/User phone number)
Message Content
To Phone Number (Business phone number)
Message Status (sent, read, delivered, failed)
Sent Date (message received date)
Updated Date (updated message status date)
Type (from user/client)
Other Things that I am not sure about:
We can't get message content If a Business phone number sends a message to a client/user from WhatsApp Business App.

Twilio - Super Sim - Incoming SMS to Sim card

I am trying to achieve 2 way messaging with a super sim. I have been able to successfully configure sms received on my virtual Twilio number to be delivered to my sim by Http post (with authentication).
I would like to find a way to send an SMS from the sim and receive the SMS at a specific phone number. I've tried several flows without any success. I was able to get this working on Make.com and retrieve the data structure of the webhook but I still cant get this working on Twilio.
Thank you for the reply.
The sim is in an iot device and I am able to achieve 2 way communication utilizing webhooks with make.com. What I would like to achieve is to utilize a virtual number with Twilio to be the associated number for the iot device.
I have successfully received incoming "SMS" messages (commands) to the iot device, using a studio flow. When an sms is received via my virtual number number on twilio, the studio flow fires an https Post with the appropriate payload, populated from the received webhook from the virtual number., in turn receiving the "SMS" on the iot device.
Now I would like to create a flow or something similar on Twilio, that would generate a Twilio webhook that would listen for SMS commands (replies) "sent from" my appropriate Super Sim.
On Make.com I am able to generate the webhook and analyze the data structure, successfully receiving the payload of the webhook, from my Sim Fleet. I would like to utilize only Twilio for the webhooks, if possible. Do you have any more suggestions? Thank you in advance.
The Twilio Super Sim is not intended for use in a phone and does not support voice or regular SMS.
The Super Sim does support sending and receiving command (machine to machine, M2M) messages over SMS which can be used to send instructions to the device or receive data from a device. In this case the sim card can send messages to the number 000 and those messages will be received by Twilio and turned into a webhook request.
There is some documentation for how to send command messages from the Super Sim from a Raspberry Pi 4 or Raspberry Pi Pico and an in depth article on AT Commands that you can use to control the Sim.

(Error: 30004) Message blocked. The destination number you are trying to reach is blocked from receiving this message

i got this message while i am trying to send sms with twilio. i never blocked any number
In my case it happened for an Indian number. For Indian number it could be blocked by the end user -
Limitations sending SMS messages to Indian mobile devices
SMS messages entering into India are categorized as “Transactional” or “Promotional” and may result as an "Error - 30004".
By default, all SMS messages sent from Twilio phone numbers are categorized as “Promotional” and are subject to the following limitations:
They cannot be sent to any phone number in India’s Do Not Call Registry
If you’ve been having trouble sending SMS messages to an Indian number, see if that number is registered on the National Do Not Call Registry.
If the owner of the phone number wishes to start receiving SMS messages from Twilio, they can update the DNC settings by following the instructions on this website.
More details : https://support.twilio.com/hc/en-us/articles/223134167-Limitations-sending-SMS-messages-to-Indian-mobile-devices
Twilio developer evangelist here.
Error 30004 doesn't mean that you blocked a number, but that the number you are trying to send to has blocked messages from your number. They could have done so by texting "STOP," "CANCEL" or other particular words to your number.
If you don't believe that this has happened, then I recommend you get in touch with Twilio support with the number that is causing this error and they will look into it.

Twillio message send fails with Carrier Network status Status Not Received/Undelivered

I sent 4 messages to a user over a few hours but only one of the messages was received (the first message).
The 3 that failed are marked as sent, however when I inspect them in the twilio sms logs the delivery step in Carrier Network says “Status Not Received” after 1 hour, then “undelivered” after 5 hours. The user was expecting the messages and has not tried to block messages from us in any way (i.e. texted STOP).
Why would he receive one of the messages and not the rest? also why would this happen?
thankyou in advance for your help!
In addition to contacting support directly you might have a look at this troubleshooting guide here and look for any of the specific error codes listed in the docs.
The errors message range in specificity answering why this could happen:
Queue overflow
Account suspended
Unreachable destination handset
Message blocked
Unknown destination handset
Landline or unreachable carrier
Carrier violation
Unknown error
Missing segment
Message price exceeds max price

How many times Twilio will try sending texts to a number which has been, out of range, network disconnected?

I am trying to understand before twilio generated error #30003, how many times it tried reaching the end cellphone #, if the subscriber's cell phone is out of range, not available? switched off, temporary disconnected and so on?
Twilio developer here.
Twilio only spends a few seconds trying to deliver an SMS message before determining that the message delivery failed. The exact amount of time varies based on which carrier is used for the delivery.
So if your first attempt to deliver a message failed but you want to try again later, you should add some logic to your application that resends the message to Twilio at a time that makes sense.
Note that Twilio does not charge you for failed attempts to send a message.
Let me know if that helps!

Resources