Twilio SMS Acknowledge Error with Calculated Roster "Number that wasn't sent that alarm", "libphonenumber missing or invalid region"

Ignition 8.0.3 stable →

Problem:
I am receiving errors trying to acknowledge an alarm via the sms response ack code using the Ignition Twilio Notification module.

Background:
We use a Calculated roster script to pull E.164 formatted numbers out of a postgres database based on custom scheduling/priority levels. I have simply been building a dictionary list of numbers to contact on the SMS alarm pipeline notification block and it has been working fine except for the sms acknowledgement part. (although I get the same results using the “builder” methods in the notification block ) **

** Note: These “users/numbers” are not tied to ignition users in any way, they are just separate numbers stored in a postgres database.

We always use E164-formatted number strings.

Errors/Logs:

When acknowledging an alarm via twilio sms, we get this log print-out:

You can see most of it looks okay, alarm goes out, response body comes back, response bodies match. But, ignition logs say that we “received an Acknowledge for an alarm from a number that wasn’t sent that alarm”.

The more interesting log is right below that one: “Error recognizing phone number”. I expanded those logs as shown below:

the phonenumbers module claims “Missing or invalid default region” which seems to me is crashing the entire sms ack method. Was there an update to that phonenumbers java library that broke this portion of the ack-ing process? Or could it be I have something configured incorrectly?

Thank you!

libphonenumber is the same version it has been since at least 2016.

Can you PM me one of the redacted numbers you’re having problems with so I can feed it into the ack manager or libphonenumber to see what happens?

Also - what Locale is your computer / gateway / Java currently configured for, and has it changed recently? The country code from the Locale reported by Java is also fed into the library’s parse method.

I have not checked the locales, running ubuntu on AWS; i’ll check and see if that’s the issue. Thank you.

I’ve just ran the number through unit tests and it parses fine here.
locale: en_US
country: US

There must be something weird going on with the country code value being passed to the library along with the phone number.

Looks like the Locale was: C.UTF-8 in ubuntu AWS.

Changing to en_US.utf8 solved the issue.

Thank you Kevin!

4 Likes