Symbian
Symbian OS Library

FAQ-1126 How can I get the IMEI or IMSI number of a phone using Symbian OS v8.0?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Telephony (ETel)
Created: 09/07/2004 Modified: 04/26/2005
Number: FAQ-1126
Platform: Symbian OS v7.0s

Question:
There is a 3rd party telephony API in Symbian OS v8.0 which provides convenient access to features such as IMEI (phone serial number) and IMSI (subscriber ID). Is there a similar capability on earlier OS releases?

Answer:
From Symbian OS v8.0 (Series 60 2nd Edition, FP2 and higher) a new 3rd party telephony API was introduced giving access to important telephony functionality This includes the IMEI and IMSI numbers, which were previously only accessible from non-public APIs. Symbian mandates that this API should be supported on all phones based on Symbian OS v8.0. However, it should be noted that the Nokia 6630, based on Symbian OS v8.0 has not unfortunately included this API, so the solutions below will not work on that phone.

    The IMEI can be obtained asynchronously as follows:

    TRequestStatus iStatus;
    CTelephony::TPhoneIdV1 iPhoneId;
    ...
    CTelephony telephony = CTelephony::NewL();
    CTelephony::TPhoneIdV1Pckg phoneInfo(iPhoneId);
    telephony->GetPhoneId(iStatus, phoneInfo));
    ...
    TPtrC theIMEI(iPhoneId.iSerialNumber);

    The IMSI can likewise be obtained from:

    TRequestStatus iStatus;
    CTelephony::TSubscriberIdV1 iSubscrId;
    ...
    CTelephony telephony = CTelephony::NewL();
    CTelephony::TSubscriberIdV1Pckg subscrIdPckg(iSubscrId);
    telephony->GetSubscriberId(iStatus, subscrIdPckg));
    ...
    TPtrC theIMSI(iSubscrId.iSubscriberId);
      The above CTelephony APIs were backported to the enhanced release of Symbian OS v7.0s, on which Series 80 and Series 60 2nd Edition FP1 were built, but appear not to have been included in any of the phones based thereon which have been released to date.

      For information about v7.0, see FAQ-1150 and for earlier releases FAQ-0808.