FIXED_LINE_OR_MOBILE

854 views
Skip to first unread message

Mathias Rav

unread,
Aug 4, 2023, 12:07:42 PM8/4/23
to libphonenumber-discuss
Hi

My internet provider in the UK uses libphonenumber to perform client-side validation that numbers entered as mobile numbers are actually mobile numbers. They do this by checking that the number type is MOBILE according to libphonenumber. However, I have a Danish mobile number (+45), and in Denmark all numbers are FIXED_LINE_OR_MOBILE (except for toll-free and premium numbers).

This seems like an honest mistake on the library user's part: When developing for a particular market where domestic numbers are always FIXED_LINE or MOBILE, and never FIXED_LINE_OR_MOBILE, then it's easy to accidentally write `getNumberType() == MOBILE`. I was able to circumvent the issue by typing intlTelInputUtils.getNumberType=()=>1 in the JavaScript console on the webpage with the mobile number form validation, which causes all numbers to return MOBILE :-)

I'd like to report the bug to my internet provider, but it would be nice to say which countries are affected by the problem to make them understand the situation.
Which countries have FIXED_LINE_OR_MOBILE numbers according to libphonenumber?

Cheers,
Mathias Rav

Kavitha Keshava

unread,
Aug 7, 2023, 4:44:10 AM8/7/23
to libphonenum...@googlegroups.com
Hi,

Thank you for using libphonenumber!

We usually store the numbers as FIXED_LINE_OR_MOBILE when we are unable to distinguish the category until 7th or 8th digit granularity or if the ranges are defined as being "Mostly land-line" or "Preferably Mobile" etc.

As per the Denmark numbering plan, the ranges are mentioned as "Fortrinsvis mobilkommunikation" (Preferably mobile communication) or "Fortrinsvis fastnetkommunikatioon" (Preferably landline communication,) so we have stored these numbers as FIXED_LINE_OR_MOBILE. This is already mentioned in our XML file file https://github.com/google/libphonenumber/blob/ddce5ce26a84262ee076cfbd07f5748eb225e76a/resources/PhoneNumberMetadata.xml#L8604.

Countries having FIXED_LINE_OR_MOBILE numbers according to libphonenumber are listed below,
  • Argentina 
  • Bangladesh 
  • Canada
  • Chile 
  • Denmark 
  • El Salvador
  • India
  • Mauritius
  • Mexico
  • Micronesia
  • South Africa  
  • St. Pierre & Miquelon
  • Tunisia
  • USA
  • Uzbekistan
  • Wallis & Futuna

--
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/c9ea337f-9cac-490f-bafc-27256bfd185an%40googlegroups.com.


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