I need to parse all the phone numbers extracted from my phonebook to lets say a flat file
The input will be a list of phone number strings which can be of the form (considering my location is India)
+91-99XXXXXXXX
98XXXXXXXX
098XXXXXXXX
011-25XXXXXX // This is a Delhi local number
0044-79XXXXXXXX // A number from England
+1-602-XXXXXXX // A number from US
602-XXXXXXX // Another number from US but missing country code
2582XXXX // A local number from Delhi but missing state STD code of 011
Now I need to store all these numbers in International format as per the libphonenumber library of google.
Now, is there any way to know (or guess) the correct country code if it is missing ?
How do I split the country code from phone number when it's available ?
And so far from what I have seen in the google's libphonenumber library, it takes input as phone number and ISO country code to parse a phone number. But how do I get the ISO country code from the numeric ISD code ?
Thanks in advance