Is your Android phone not associating Caller Idenfication (CID) with your contacts, due to country code prefixes? Then this article is for you.
The Problem
Operators worldwide to do not adhere to a unified policy on including country code prefixes, in the caller ID string.
Below are some examples:
CID for Incoming Calls | CID for Incoming SMS Texts | |
Maldives | XXX XXXX | +960 XXX XXXX |
Sri Lanka | (XXX) XXX-XXX | +94 (XXX) XXX-XXX |
Therefore, during an incoming call in home country, your phone only associates the CIDs with your contacts, only if there is an exact match in your contacts (i.e., if numbers are stored without country codes). This is case is not true when you are roaming (when the CID includes a country code prefix)!
Recent unrooted Android 2.+ phones, scan for an exact match in your contacts and does not scan within the CID string.
Ideal Solution
Ideally there are two solutions to this problem. Either operators always included the country code prefix or, the mobile phone (or its software) scanned within the CID string.
After some enlightening discussions with some friends, I realized that operators may not embrace a unified policy to include country code prefixes for branding reasons. Furthermore, it would created a hassle to dial and read extra numbers for the majority of the population, who do not subscribe to roaming packages.
The next solution would be to wait for a firmware / software update, which may or may not include a fix to scan within the Caller ID string.
A Workable Hack
After some thought, I managed to work around this problem. Here is what to do:
- Make a back-up of your Address Book (mac) and / or Google Contacts, should you have a need to roll back.
- Make sure you have all the phone numbers with the country code prefix in your Address Book (for mac) or in Google Contacts. Spring clean your contacts for consistency. Make sure you do not have two people with the same name! If you do, insert a unique identifier.
- Export them to a Google Contacts friendly .csv (comma seperated values) text file. AddressBook2CSV is a freeware to do just that on Mac OSX.
- With a decent text editor, use the FIND AND REPLACE ALL command to find all “+<country code>” prefixes and replace these with a null strings (“”). That should strip-off the country code prefixes. I used Bare Bones’ TextWrangler.
- Save your .csv file and import it back to your Google Contacts. This should create duplicate contacts and your contacts count should double.
- Use Google Contacts’ FIND DUPLICATES (see image below) to find and merge duplicate contacts. It should do a pretty good job provided your contacts are well organized, as by now, all the contacts’ details should be consistent, except for the country code prefix in one and none in last imported contacts.
What this effectively does is that for each phone number of each contact, you would have two phone numbers, one with the country code prefix and one without.
This way, whether you receive your CID with the country code prefix (such as SMS Texts and incoming calls while roaming) or receive incoming calls locally (without country code prefix), your phone should scan and find an exact match to your synchronized contacts with your Google account.