Well, that is an expected result from swapping a SIM card.
The "decompo*******Number" routine will work based on the country code that is informed by the SIM card and the current network operator. When you go to another country and put a new SIM everything changes.
There are 3 scenarios:
a) Being at your own country, with your "default" SIM. The SIM and the Network country will be the same and the address book will be populated according to these country rules
b) Roaming in another country: this will cause the actual operator to change, so you will still receive your country as the SIM cards country and the roaming country as the current operator. I'm curious how the phone will decompose the number in this case. My guess is that it should try a match with the operators country first and then with the SIM country.
c) In a different country, with a SIM card from that country. Now both country settings will be the same as will be other country. Since the entries in the Address Book are made for original country, it will NOT work. This is expected.
That is why I still think that the x-rightmost matching is the way to go. Mobile phone manufacturers long ago found that matching the last 6 numbers would suffice. AT&T and Apple came up with the "decompose" rules and created such as mess.
This is only true if you store your phone numbers in non-international format in your address book. If you store them in international format (with "+" prefix) then it does not matter where you are or which SIM card you use, the decompo*******Number function will be able to decompose the phone number, but only if phone number templates exist for that country.
Example: Even though I tell the decompo*******Number function that the country is Argentina, it knows the phone number is Belgian.
Code:# Framework AppSupport decompo*******Number +3231234567 ar 1,"32","","3","1234567"
Last edited by timschuerewegen; 12-17-2007 at 02:06 PM.
Here's my improved phone number support for AppSupport. (only for firmware 1.1.2)
- Download latest "PhoneNumber Dynamic Library" zip file from http://users.skynet.be/ra045246/ and extract it.
- Copy "AppSupport" and "AppSupport.original" to /System/Library/Frameworks/AppSupport.framework/ on your iPhone.
- Copy "PhoneNumber.dylib" and "PhoneNumberTemplates.txt" from the Support directory to /System/Library/Frameworks/AppSupport.framework/Support/ on your iPhone. Create the Support directory on your iPhone if it does not already exist.
- Add templates for your country to the "PhoneNumberTemplates.txt" file. Remember to use a sequence of # characters instead of numeric values for area code and subscriber number. (e.g. "be 32 00 0 2 6" becomes "be 32 00 0 ## ######")
- Reboot iPhone.
I also included a special version of PhoneNumber.dylib that won't use phone number templates. Instead it uses the x rightmost digits. If you want to use the x rightmost digits approach then overwrite PhoneNumber.dylib on your iPhone with PhoneNumber-x.dylib (where x is the number of rightmost digits).
Last edited by timschuerewegen; 12-24-2007 at 12:08 PM.
Sorry for being ignorant as I have not been here for a while - is iWorld not dealing with all of this?
Thanks Tim - so your fix takes care of both the SMS and the dialing issue and all I need to do is to add my country?
Are there any other problems with 1.1.2? Wondering if it is worth updating from 1.1.1...
But the problem is that dialing local numbers in "international" format is not always possible. I can't do it for example, as it will not be possible on countries with more than one NDD - for more than one long distance operator - and no default LD operator. So here the so called "international" or "universal" format does not apply and I will be there are other places like that too.
Bookmarks