Reputation: 2308
I am trying to validate mobile numbers using the javascript version of Google's libphonenumber. I first check if the number is valid or not and then if its valid i check if its type is mobile. The problem that i am facing is that if a US mobile number is checked, it comes as a valid but not a mobile number. So the feedback i get is that the number is a legal US number but not a US mobile number. I know their is no way of distinguishing between the two, but in such cases shouldn't the feedback be 'cannot tell' instead of a 'No' .
I thought of posting it as an issue but then i thought i should confirm that i am right, i might be missing something. So can some one please confirm this or just guide me if i am doing something wrong.
Upvotes: 3
Views: 3299
Reputation: 2308
I know its late but if anyone comes to this question later, it was my mistake. They do have a status PNT.FIXED_LINE_OR_MOBILE for situations where they cannot decide if its a landline or mobile number.
Upvotes: 1
Reputation: 522081
This is a tricky topic. If you are serious about the distinction, you'll have to subscribe to a regularly updated database of international phone numbers, like this one (not affiliated, associated or anything, just happen to know them). With it you'll be able to associate a number(-prefix) with a carrier, which is surprisingly more varied, complex and ever-changing than you might expect.
Which is the reason why libphonenumber cannot give 100% accurate results. I don't know if it could even return "don't know" with any certainty.
Upvotes: 2