daddyz / phonelib

Ruby gem for phone validation and formatting using google libphonenumber library data
MIT License
1.08k stars 132 forks source link

Some numbers cannot be validated correctly #320

Open Ahmed-Salama96 opened 4 weeks ago

Ahmed-Salama96 commented 4 weeks ago
Screenshot 2024-10-28 at 10 45 06 AM

in the attached screenshot i've two numbers one for +20 and other for +55. I'm trying to put the country code twice in the number to make it wrong, but the number +55 considered as true in the gem, and this making an issue on our twilio

"Twilio::REST::RestError: [HTTP 400] 21614 : Unable to create record 'To' number: +555592150XXXX, is not a valid mobile number"

abhinav-1050 commented 2 weeks ago

@Ahmed-Salama96 Did you find any solution?

Ahmed-Salama96 commented 2 weeks ago

Nope @abhinav-1050

abhinav-1050 commented 2 weeks ago

Try using this in your initializer file.

Phonelib.strict_double_prefix_check = true

Ahmed-Salama96 commented 2 weeks ago

Tried that but still same

Ahmed-Salama96 commented 2 weeks ago

even if i try Phonelib.valid_for_country?('+5555921509051', 'BR') it returns true

daddyz commented 5 days ago

This number is also parsed as valid in original libphonenumber. You can check it here and open an issue for them. Gem's data is based on it.

Ahmed-Salama96 commented 5 days ago

Thank you @daddyz , i opened an issue there https://issuetracker.google.com/issues/379888479