views:

710

answers:

2

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)

A: 

See this question. You could use TAPI to get the number, but I am not sure that it will work in all phones/operators.

kgiannakakis
+3  A: 

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

Matt Lacey
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
and example of CDMA phones?
Schildmeijer
CDMA ~=3g? => e.g. X1 is a CDMA phone?
Schildmeijer