libphonenumber parses invalid number as valid

113 views
Skip to first unread message

Abdelrahman Khattab

unread,
Oct 30, 2023, 12:26:50 PM10/30/23
to libphonenumber-discuss
Attached below is an invalid and not possible US number though the library returns a valid and possible.

why does it return valid and possible in this case and is there a way to avoid that for this case? 


Phone number: +115005550009
Screenshot 2023-10-30 at 6.19.31 PM.png

Kavitha Keshava

unread,
Oct 31, 2023, 12:11:25 AM10/31/23
to libphonenum...@googlegroups.com
Hi,

Thank you for using libphonenumber!

Usually, when parsing, we remove a country's national or trunk prefix, so we can store a normalized form of the number. 
In this case +115005550009, '+1' is country code and the next '1' is the national prefix of the United States. After parsing we get the 10 digit number 5005550009.
NPA 500 is categorized as 'Personal Numbers' and the complete '500-555' range is valid since 09/21/2023 as per NANPA.
Therefore it is a valid and a possible number and the same is supported by our library.


--
You received this message because you are subscribed to the Google Groups "libphonenumber-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libphonenumber-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libphonenumber-discuss/6955baa9-f06e-49ba-837c-961a202ef892n%40googlegroups.com.


--
Thanks & Regards,
Kavitha
Reply all
Reply to author
Forward
0 new messages