Correct me if Im wrong. Not all operators implement the feature that lets you retrieve the phone number connected to the SIM card. So Im curios about if there is someone with experience regarding this issue on Windows Mobile (primary version 6.0/6.1)
2 Answers
You can't always get the phone number from the SIM card as it may not be there. Details at http://www.newlc.com/topic-5211 (Basically, the phone number is used by the network to route to the SIM registered with the number. The phone doesn't use it so doesn't need it.)
The only thing guaranteed to be on the SIM is the IMSI. There's an example of how to get this at: http://xman892.blogspot.com/2007/07/how-to-series-retrieving-imsi-and-imei.html
There's a C++ sample in the SDK, but this isn't guaranteed to work on all phones. You'll find it in: C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\GetPhoneNumber
This may also be useful: http://blog.opennetcf.com/ncowburn/CommentView,guid,309b8b8e-ebc7-4078-a8ba-f174761ea7af.aspx

- 65,560
- 11
- 91
- 143
-
The phone number is available on CDMA phones, that is when the sample works. You are correct that on GSM (SIM based) phones it is not available. – Shane Powell May 27 '09 at 19:10
-
CDMA ~=3g? => e.g. X1 is a CDMA phone? – Schildmeijer May 27 '09 at 21:53
See this question. You could use TAPI to get the number, but I am not sure that it will work in all phones/operators.

- 1
- 1

- 103,016
- 27
- 158
- 194