Does the Twilio module support international numbers? I’m trying to send an SMS from another country but the gateway log says that the format of the phone number is not correct. I’ve checked the number and everything seems to be fine. I’m trying to send a message to Costa Rica so the number format I’m using is +506 1234 5678
It should work, but I’m not sure what the number format is supposed to be. It may depend on the country you’re sending from as well.
Have you tried prepending 011 to the number yet? 011 506 1234 5678
I tried prepending 011 to the number as you said but it didn’t work.
I’m using a “+1 409 123 4567” number (USA) to send the SMS to a “+506 1234 5678” number (CR). I’m using an USA number because the trial account in Twilio doesn’t let me choose one from Costa Rica. But I tested the communication in the Twilio API and it works.
Did you manage to get this to work? I am currently trying to send to a Danish number but receives the message:
Caused by: java.util.concurrent.ExecutionException: com.digitalpetri.ignition.twilio.accounts.TwilioAccount$TwilioAccountException: To number: +45XXXXXXXX, is not a mobile number
Gateway error like this:
com.twilio.exception.ApiException: The 'To' number 0045XXXXXXXX, is not a valid phone number. at com.twilio.rest.api.v2010.account.MessageCreator.create(MessageCreator.java:505) at com.twilio.rest.api.v2010.account.MessageCreator.create(MessageCreator.java:25) at com.twilio.base.Creator.create(Creator.java:45) at om.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.lambda$sendSms$6(TwilioAccount.java:344) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
DK numbers are structured with 8 digits. And international code is +45.
Testing with the code example number I reach the Twilio service and a successful send.
It seems Twilio does not support two-way SMS in Denmark: https://www.twilio.com/guidelines/dk/sms
edit: however I don’t know if this means you shouldn’t be able to send an SMS not expecting to interact or receive a reply…
Since the birth of Twilio they have some more stronger dependencies on which twilio number is sending to which country. Meaning that sending to Danish numbers you need to have a danish twilio number.
With that set up it works very fine:)