I’m wanting to incorporate Google’s libphonenumber library into a CRM solution that I’m working on, to identify things such as:
- Whether a phone number is mobile or landline
- Geo-location of the number
I’ve done some searching online, and can’t seem to find anything discussing what algorithms the library is using to determine this information, and how reliable those methods are.
Is there any such documentation (ie, details of the these algorithms and their respective reliability)? Or really, anything to help me understand what happens under-the-covers for this library?
It’s an Open Source library, so you can see exactly how it works 🙂
I’ve had a quick look at the source, and it seems to work by testing the phone number with a series of regular expressions. Big regex files are defined for various countries, which define the regular expressions that will tell you the type of phone number (for example, in the UK, all mobiles start with “07”, so there will be a regex based on that).