views:

1428

answers:

5

How to get the phone number of the device in Symbian?

+1  A: 

FYI: Actually i have found this.

http://www3.symbian.com/faq.nsf/AllByDate/100335073FFD8FEF80256E3200571A49?OpenDocument

But the fact is, the phone number is not always stored in SIM. The operator chooses to do it or not!

Prakash
A: 

You can't. Afaik.

Check this discussion: http://discussion.forum.nokia.com/forum/showthread.php?t=65117

Till
+5  A: 

According to the GSM specs, only the IMSI is required to be available on the SIM card.

The actual phone number MSISDN is stored on the HLR database in the operator's network and does not need to be available on the SIM card or transmitted to the phone.

So no matter what technology you are using (Symbina, Java ...) you can never count on being able to consistently get your own phone number from the device or SIM. You might be lucky if the operator stores it on the SIM or if the phone provides the user with a possibility to enter it manually, but it does not have to be this way.

Pat
Also, if you do find the MSISDN is stored on the SIM, it might not be the right one. If you have ported your number from another network, then you may find the MSISDN you read from the SIM is the original number, not your ported number.
Rob Charlton
A: 

It is not generally possible to get the MSISDN from a Symbian device (or BREW, or any other platform). We've tried.

Airsource Ltd
+2  A: 

As Pat has said, although there are APIs for accessing the "own number" slot on the SIM, rarely in my experience is this slot filled.

The usual strategy for obtaining the phone number for a connected application is to send an SMS as part of a verification process. Either:

  1. Programatically send an SMS from the handset to your server (lots of good SMS gateway interconnect providers out there). The SMS will arrive at your server 'from' the number of the handset (or the SIM to be more correct). Of course the SMS should contain some token so the server can link it with a given session/user. This has the advantage that you don't need the user to enter their own phone number (which is fraut with subtle difficulties given few folks understand how to format numbers in E.164 format). One disadvantage is that the process can cost your user money (one SMS).

  2. Have the user enter their phone number (web site or on the handset) and connect to your server, passing that phone number. Have the handset then wait for an SMS to arrive that you send from your server. If this SMS does indeed arrive, you have verified the phone number they entered as correct and valid. Obvious disadvantage is that this relies on the user to enter their number correctly - again, given the plethora of ways of writing phone numbers around the world, its not as trivial as it sounds to normalise numbers to E.164....

Alas, neither of these methods are bullet-proof, particularly because SMS is an unconnected transport. Depending on GSM network load, the load of your gateway provider, phase of the moon and direction of window blowing an SMS can take a second to a month to arrive (yes, I do have experience of the latter). The mean delivery time is often in the seconds, but you do have to play with the operation timeout and might have to tweak it on a geographical and GSM network basis. [And no, don't rely on delivery reports - even more unreliable than SMS delivery]

KevinD