Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Universal International Freephone Number not considered valid #314

Closed
pedro-trindade opened this issue Sep 2, 2024 · 1 comment
Closed

Comments

@pedro-trindade
Copy link

Hello amazing PhoneLib team 👋🏻
Per google's libphonenumber, universal international freephone numbers, such as +80050001001, are considered valid:

Validation Results:
Result from isPossibleNumber(): true
Result from isValidNumber(): true
Phone Number region: 001
Result from getNumberType(): TOLL_FREE

However, using PhoneLib I'm getting these results:

inspect: #<Phonelib::Phone:0x000000010529b318 @original="+80050001001", @extension="", @Sanitized="80050001001", @original_s="+80050001001", @DaTa={}, @national_number="80050001001">
valid?: false
invalid?: true
possible?: false
impossible?: true
types: []
type:
human_types: []
human_type:
possible_types: []
countries: []
country:
valid_countries: []
valid_country:
country_code:
national: 80050001001
international: +80050001001
e164: +80050001001
national_number: 80050001001

Would it be possible to add support for these numbers in PhoneLib?
Wikipedia info for UIFN

Thank you so much for your incredible work and your support! 🙏🏻

@daddyz
Copy link
Owner

daddyz commented Dec 16, 2024

@pedro-trindade added support for such numbers

p =Phonelib.parse('+80050001001') # => #<Phonelib::Phone:0x000060350c879500 @original="+80050001001", ... 
p.valid? # => true 
p.country # => "International 800" 

@daddyz daddyz closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants