eric-brechemier / how-i-replaced-skype-with-twilio

How I replaced Skype with Twilio to make phone calls from my computer
Creative Commons Attribution 4.0 International
43 stars 9 forks source link

Authentication SMS messages are never received by my Twilio phone number #13

Closed eric-brechemier closed 2 years ago

eric-brechemier commented 2 years ago

I have set up my Twilio phone number with some services that require a code sent by SMS for authentication. Although I do receive ordinary SMS messages successfully on this number, I have never received any of the authentication messages.

eric-brechemier commented 2 years ago

Until recently, I did not know what made these authentication SMS messages special. I contacted the support of the authentication service provider and they assured me that the SMS messages had been successfully sent on their end, but nothing was showing in my Twilio console.

I perused the Twilio knowledge base searching for any issue related to the failed reception of SMS messages and I found the following issue of interest:

By default, Twilio long code numbers cannot receive messages from short code numbers. (...)

eric-brechemier commented 2 years ago

I checked the details of these authentication SMS messages on a regular mobile phone where they had been successfully received and I confirmed that the sender was not shown as an international phone number but as a short text identifier.

I considered carefully the different limitations of inbound SMS sent from short codes, as stated in the knowledge base article:

  • The setting is applied to your Twilio Account SID, and will affect all of the long code (local, national or mobile) SMS-capable numbers that belong to the Account SID you have requested.

I have a single phone number in my account, so that's not an issue for me. But if I intended to create additional phone numbers for a different usage, I understand that I should create a separate account for that. I currently have three of these Twilio accounts all accessible from the same user login. I can switch easily from one to another using a menu at the top of the page, it is only relatively cumbersome.

  • Short codes and Toll-Free numbers cannot receive SMS from short codes, and will not be affected by this setting.

I have a regular Twilio phone number, I am not affected by that.

  • By design, a short code number can only send messages to long code numbers from the same country as that short code. In order to receive messages, you must use a Twilio number from the same country as the short code. For example, if you are trying to receive messages from a Canada short code, you will need to use a Canada Twilio number.

That's good to know. When signing up to an online service in a different country, my Twilio phone number may or may not receive short code authentication messages. They won't be received unless the service provider has registered their short code number in the same country as the one of the phone number I have used to sign up.

  • Twilio cannot guarantee that every short code globally will be able to reach Twilio numbers, even if the Twilio number is from the same country as the short code. There may be cases where an external short code carrier does not have reach to Twilio, or some other technical issue prevents those messages from reaching our platform.

Got it. There is no guarantee to receive short code messages from certain service providers even once the feature has been enabled.

  • Some companies may choose only to send OTP codes to mobile numbers. This is common in larger companies including OTP from Apple, Microsoft, Google, Facebook, and WhatsApp.

Got it. Some of the largest service providers may refuse outrightly to send authentication messages to phone numbers that they identify as provided by a VoIP platform rather than a regular phone company.

  • You will NOT be able to send outbound messages to these short codes. Therefore, you will not be able to reply, opt out via "STOP," or send "HELP" messages. Before enabling this setting, our Support team will send you a disclaimer from our Legal team and ask you to confirm that you understand and accept this particular limitation.

That may or may not be an issue. I don't remember the last time I had to provide an answer to a notification SMS by answering by SMS. That is not certainly not happening with any authentication messages anyway.

eric-brechemier commented 2 years ago

I have requested the feature to be enabled on my Twilio accounts and I received an answer promptly. It restates the limitations to be acknowledged before enabling the feature:

By default, Twilio accounts are not enabled to receive incoming messages from short code numbers.

However, we have recently added the ability to enable long code phone numbers on your Twilio account to receive these messages. I can help enable this, but first we have to get your consent and acknowledgement of these key details:

  • This feature, when enabled, will cause your account to receive incoming messages from short code numbers. The setting is account-wide and will affect all the long code numbers that belong to your Twilio account.
  • Short code numbers can only reach numbers from the same country as the short code. Therefore, you must ensure you're using a Twilio number from the same country as the short code, in order to receive messages. For example, if you are trying to receive messages from a Canada short code, you will need to use a Canada Twilio number.
  • Twilio cannot guarantee that every short code will be able to reach your Twilio number,even if the Twilio number is from the same country as the short code. There may be cases where a short code carrier does not have reach to Twilio; certain short code providers cannot reach some VoIP platforms. Some companies may also choose not to send to VoIP platforms. This is common with OTP messages from larger companies such as Apple, Microsoft, Google, Facebook, and WhatsApp.
  • You will not be able to send outbound messages from your Twilio numbers to short codes.

Lastly, we need to get your confirmation that you have read and understand the following opt-out limitations with this feature from our legal team:

"By enabling this feature, you understand and acknowledge that you will be unable to send messages from your Twilio long code number(s) associated with this account to any short code numbers, including, but not limited to, reply messages such as standard opt-out or help messages (i.e., STOP, UNSUBSCRIBE and HELP). You agree that you will inform all end users of your Twilio long code numbers that they will not be able to send such opt-out messages, provide a copy of this message to your end users, and record their agreement to its terms. You also agree that neither you nor any of your end users will hold or seek to hold Twilio liable in connection with any failure to deliver messages, including opt-out or help reply messages, that are attempted to be initiated from your long code number(s) associated with this account to short code numbers, including, but not limited to, with respect to claims brought under the Telephone Consumer Protection Act, CAN-SPAM, or any similar laws in any country around the world. You agree to indemnify Twilio and hold Twilio harmless for any claims brought by third parties that arise from the failure to deliver messages of any kind, including reply messages, from your long code number(s) associated with this account to short codes. You also agree not to bring suit against any third party for failure to respond to messages you or your end users attempted to send to a short code number from your Twilio long code numbers."

If you understand and accept these terms and limitations, please reply letting us know you accept the terms and limitations, and you would like to enable this feature on your Twilio account.

Please confirm the Twilio Account SID(s) you'd like this feature enabled on, and I will get it enabled for you.

eric-brechemier commented 2 years ago

I have acknowledged and agreed to the limitations and confirmed my request by providing the Twilio Account SID which can be found in the Account Info section on the home page of each account.

eric-brechemier commented 2 years ago

The feature has been enabled for my three Twilio accounts. After making a new authentication test, I received the SMS messages immediately. The Twilio console logged the sender as a short number of 5 digits.

I am glad that it worked for me with this service provider, although I understand that different providers may or may not succeed to send me authentication messages in the same way. YMMV.

Feel free to leave questions and comments below.

niyon-x commented 1 year ago

Mate have you tried whatsapp and received the code?

eric-brechemier commented 1 year ago

No, I have not tried to receive SMS messages from WhatsApp. AFAIK, you need to have WhatsApp installed on an actual mobile phone anyway, even to use it on a computer. WhatsApp Web displays a QR code that you need to scan from the app to activate it, and the mobile phone needs to keep an active Internet connection to keep WhatsApp Web running on the computer.

I have used an Android emulator to run WhatsApp inside a virtual mobile phone on a computer. It worked but it was too cumbersome so I stopped after a short while.

niyon-x commented 1 year ago

@eric-brechemier no worries. Thanks