5

So, I have WHMCS setup to use Twilio with a new module, however, I have managed to get as far as setting it up and having SMS messages go out to customers in Australia as I have an AUS number connected to my Twilio account.

The issue is that when say for an example a US customer signs up the SMS fails and says "cannot send sms", the logs aren't helpful for this Twilio newb.

Here is the example: The process of sending SMS to the user phone number (+1310xxxxxxx) from the summary page has failed - Twilio (company name)

If I was to send a message to say Spain it seems to work, which is odd enough.

I also tried on a +34 and it sent. Also seems to work on the UK +44.

I have GEO options setup to work as they should within Twilio, though, the error message does not appear on my Twilio logs, simply internal.

Here is the module log.

I have only edited the text out to give you what is showing.

Request:

Array
(
    [To] => +1310xxxxxxx
    [Body] => test
    [From] => Company name
)

Response

The 'To' phone number: +1310xxxxxxx, is not currently reachable using the 'From' phone number: Company name via SMS.

So presently SMS messages to the USA do not work, I cannot speak for every other country out there though, what can I do here or how would I set my Twilio account correctly to ensure my SMS messages are being delivered?

Many thanks.

Sean Banks
  • 51
  • 1
  • 2

1 Answers1

5

Twilio developer evangelist here.

From what you're saying I think you're sending messages using an alphanumeric sender ID rather than a phone number?

If that's the case then you are getting rejected from the US because the US telephone system doesn't accept alphanumeric sender IDs (neither do some other countries, just not the ones you've tested). You can see the countries that do and don't support alphanumeric sender IDs in this table in our documentation.

To fix this you'll need a number to send the messages from in the US, I'd recommend getting a new US number for this.

Then you can either catch the error and retry using the number in place of the sender ID.

Or, for a more resilient method, take a look into Twilio Messaging Services that can do automatic failover to a number when sending with alphanumeric senders.

Let me know if this helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Thank you :) I am using a module called "SMS Center" which was made by Module Garden. The way I have it set is to have an sender ID established as our business name, however, it doesn't seem to allow me to leave the field empty. – Sean Banks Jul 17 '18 at 09:04
  • I have a USA number on my account also, so I am not sure how I need to fix all of this, I would imagine I will need to contact Modules Garden to figure this all out as we do use this for our customers to validate their numbers before they can access their client area so if they never receive the SMS they won't even be able to pay an invoice even on a new order unless I deactivate it. – Sean Banks Jul 17 '18 at 09:08
  • I've managed to get the USA number to work now with the use of just the US listed number I have on Twilio, the next issue is that it is not used by default and I can only use one default option per new connection. – Sean Banks Jul 17 '18 at 10:44
  • I'm not sure how I can help I'm afraid. SMS Center is a paid for product, so I recommend you get in touch with Module Garden and tell them what's going on. You can point them to this answer if it can help them at all. – philnash Jul 17 '18 at 22:59
  • I think I found the issue, I did another test on a US number, I had it set so that the country USA would be separate from the other countries I had listed, that didn't work, so I then had USA, USA Virgin Islands, etc set in the same and it worked. – Sean Banks Jul 18 '18 at 11:22
  • Good to hear you're all sorted then! – philnash Jul 18 '18 at 14:58