Open AdamJacobson opened 3 years ago
@AdamJacobson this gem's data is based on google libphonenumber and it has "1" as country code since it is required for proper parsing, I will try to find a way to solve your issue.
please ensure that Puerto Rico phone numbers are still part of the US. :heart:
Phonelib.parse("+1 787-671-1234").country_code
=> "US"
Parsing a valid DO number does return 'DO' as the country:
But the country_code for dialing is simply returned as '1' which is the same for US/CA making country information lookups using this data problematic. Twilio specifically gives ["+1829", "+1809", "+1849"] as the possible codes for DO.
Is this a bug or is there a better way to get the full dial code that I am not aware of? I've noticed similar problems with other countries that have the dial code start with '1', including Bahamas and Puerto Rico.