Twilio delivers long SMS messages in random order - twilio

When my Twilio numbers receive an SMS longer than 160 chars, I get a call to my server with each 160 char fragment. Each server call is like a separate SMS. The order in which I receive them is random.
Does anyone have a solution to this other than manually assemble these fragments?
Does anyone know of a replacement to Twilio?. It should support:
sending and receiving SMS world wide.
sending and receiving SMSs that are longer than 160 chars. (i.e. deliver multiple messages in the right order)
easy python/django integration.
Checked out Plivo's API. Did not find a solution there for receiving long SMSs

Apparently nexmo does what I need.
It works all over the globe.
It solves the problem of long inbound SMSs

Related

Is there a Twilio outbound SMS magic number that hits a timeout value?

I'm testing some flows that use outbound SMS via Twilio and have been really pleased and impressed by the magic numbers provided e.g. https://www.twilio.com/docs/iam/test-credentials
However, I'm interested to see how our application responds if there's some issue sending an SMS to a number where it essentially hits a timeout value. I haven't found a magic number such as this or know of a way to recreate the scenario, can anyone help me here?
Even if you were using a real auth credentials and real phone number (instead of magic number), I suspect Twilio just queues the request on their side and responds with a HTTP 201, so you'll always get a very fast response from Twilio, but it doesn't necessarily mean the message has been sent to a carrier and delivered to a device.
If you're using Twilio messaging services, you can subscribe to delivery status callbacks to get the status of a SMS e.g. sending, sent, delivered, failed, etc - see here. Note: I don't know if you'd receive callbacks with magic numbers - I suspect not... either way you can provision a Twilio phone number pretty cheaply to test e.g. in Australia (where I'm from) I can purchase a AU phone number for $6 per month and I can release the phone number when ever I want to stop getting billed for it...
If you just want your app to timeout on invocation of the Twilio API you can do something like the following (in .NET core) to force timeout a request in a specified amount of time (1 second in example below):
using var tokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(1000));
response = await twilioHttpClient.PostAsJsonAsync($"2010-04-01/Accounts/{accountSID}/Messages.json", request, jsonSerializerOptions, tokenSource.Token);
If timeout is exceeded, an exception will be thrown that you can handle. Note: there's various networking tools that can be used to block or limit outbound requests, which you can use to test timeout scenarios.

Clearing/Deleting messages in Twilios SMS Message Queues

We had some sort of bug that queued up the same message thousands of times, each of them is undelivered because of the spam carrier restrictions, because it was a not real number or something.
We've looked around their docs and stack overflow but can't find anything that looks relevant.
It seems like Twilio keeps trying though - over and over - so it's send out thousands of the same message and keeps queueing them. Or at the very least
How can we clear our whole SMS message queue? We're happy if we never send it again, as nothing in there is mission critical.
The best approach is a ticket to Twilio support via the Twilio Console or help#twilio.com as a P1 (with you Account SID), indicating you have an out of control process queuing up thousands of SMS messages.
They will ask that you fix the process and fail the messages in queue.

Using Twilio SMS I want to send a multi-segment message but tell Twilio where to break the message

I want to send SMS messages greater than 160 characters (say 240) and normally Twilio willl auto-segment as necessary. I would like to tell Twilio where to break the messages (say three segments of 80 each). We want to be sure the each segment arrives to the destination in the correct order and with logical message breaks.
It is not possible to programmatically handle the segmentation yourself. A SMS message over a certain length (based on GSM7 or UCS2 encoding) will be automatically handled. If you want to send 3 separate segments of 80 bytes, make 3 separate API requests overtime which will show up as 3 separate SMS messages on the mobile terminated device.
Does Twilio support concatenated SMS messages or messages over 160 characters?

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

How to stop a number from sending replies

There is a number that has been automatically replying with SMS, and of course each reply costs money. It was not a number that was ever sent a message to, so it is baffling as why it is sending automatic responses back.
How does one block a number so not to receive messages from?
Update : Made it clear that reply was in SMS format.
I can't comment yet but please see this
Unlike voice, there’s no way to block specific SMS messages or sending
parties

Resources