By: Sergio Junior user 27 Nov 2020 at 6:37 p.m. CST

6 Responses
Sergio Junior gravatar
Im experiencing issues with the Mobile Registration using Twilio with CASA. Any valid numbers log the following errors 27-11 21:19:26.601 ERROR [qtp349420578-145] plugins.authnmethod.service.TwilioMobilePhoneService TwilioMobilePhoneService.java:85- No message was sent, error was: The 'To' number 5511900000000 is not a valid phone number. (I removed the real number) This is a valid phone number. I tried several others from Brazil and the result is the same. Maybe the API needs the PLUS sign on front and CASA is not sending? Following the http requests, when i inserted the number (before pressing the button) i can see a response from the API: {"rs":[["setAttr",[{$u:'wHEPx1'},"value","A six-digit code was delivered to 5511900000000. Enter it to verify your phone."]]],"rid":12} But clicking on the button returns {"rs":[["invoke",[null,"showAlert","An error occurred","error",5000]]],"rid":13} And the log is 27-11 21:19:26.601 ERROR [qtp349420578-145] plugins.authnmethod.service.TwilioMobilePhoneService TwilioMobilePhoneService.java:85- No message was sent, error was: The 'To' number 5511900000000 is not a valid phone number.

By Jose Gonzalez staff 29 Nov 2020 at 10:30 a.m. CST

Jose Gonzalez gravatar
Should work as is. Check your twilio account is able to send sms to numbers in Brazil. Also, in twilio dashboard there is access to a sandbox where you can test SMS delivery.

By Sergio Junior user 29 Nov 2020 at 11:41 a.m. CST

Sergio Junior gravatar
Jose I appreciate your response. Before opening this request we performed all tests, our twilio account is also being used at our systems without issues.

By Arthur Barrett user 15 Jun 2021 at 9:18 p.m. CDT

Arthur Barrett gravatar
I'm experiencing the same issue with Gluu 4.2.3 on Ubuntu 18. I've submitted a support ticket to Twilio in the hope they can provide more detailed information about what is wrong. https://www.twilio.com/console/support/tickets/6402223 I can send to US cell phone numbers, but not UK or AU cell phone numbers. In Twilio the geoblock us set OK: https://www.twilio.com/console/support/tickets/6402223 I'm using a twilio trial account and I've verified all the phone numbers I'm trying to use. I'm using twilio-7.17.0.jar which is what comes with gluu 4.2.3 any suggestions appreciated.

By Arthur Barrett user 16 Jun 2021 at 9:38 p.m. CDT

Arthur Barrett gravatar
Twilio wrote back saying they are looking at the log files and also requested acess to the source code. The code is here: https://github.com/GluuFederation/casa/blob/version_4.2.3/app/src/main/java/org/gluu/casa/plugins/authnmethod/rs/MobilePhoneEnrollingWS.java Which calls this: 'https://github.com/GluuFederation/casa/blob/version_4.2.3/app/src/main/java/org/gluu/casa/plugins/authnmethod/service/TwilioMobilePhoneService.java#L62' The 'label' (usr.mobile_sms_body) is defined here: 'https://github.com/GluuFederation/casa/blob/version_4.2.3/app/src/main/resources/labels/user.properties#L136'

By Arthur Barrett user 16 Jun 2021 at 9:57 p.m. CDT

Arthur Barrett gravatar
Iā€™m pretty sure the answer is going to be: https://stackoverflow.com/a/58581491 ie: the format must be a number up to fifteen digits in length starting with a ā€˜+ā€™. https://www.twilio.com/docs/glossary/what-e164 The fact twilio accept 1XXXXXXXXX numbers without a '+' is a bug, but the fact that gluu casa does NOT add the + is a bug in Gluu CASA.

By Arthur Barrett user 16 Jun 2021 at 10:05 p.m. CDT

Arthur Barrett gravatar
I've added a bug report here: https://github.com/GluuFederation/casa/issues/138