This page was last modified 14:41, 8 December 2007.
Reading IMSI in 3rd Edition
From Forum Nokia Wiki
CImsiReader example illustrates how to read IMSI (SIM card's identity number, which has nearly nothing to do with the MSISDN that is the phone number used for calling) in 3rd Edition Symbian devices. Note that this code will most likely not work in the emulator, thus you should only use it in real devices.
IMSI_Getter.cpp
#include <COEMAIN.H>
#include <BAUTILS.H>
#include <apmrec.h>
#include <apgcli.h>
#include <smut.h>
CImsiReader* CImsiReader::NewL(MImsiObserver* aObserver)
{
CImsiReader* self = NewLC(aObserver);
CleanupStack::Pop(self);
return self;
}
CImsiReader* CImsiReader::NewLC(MImsiObserver* aObserver)
{
CImsiReader* self = new (ELeave) CImsiReader(aObserver);
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CImsiReader::CImsiReader(MImsiObserver* aObserver)
:CActive(0),iObserver(aObserver),iImsiV1Pkg(iImsiV1)
{
}
CImsiReader::~CImsiReader()
{
Cancel();
delete iTelephony;
}
void CImsiReader::ConstructL(void)
{
CActiveScheduler::Add(this);
iTelephony = CTelephony::NewL();
iTelephony->GetPhoneId(iStatus,iIdV1Pkg);
SetActive();
}
void CImsiReader::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetSubscriberIdCancel);
}
void CImsiReader::RunL()
{
iTelephony->GotIMSIL(iImsiV1.iSubscriberId,iStatus.Int())
}
IMSI_Getter.h
#include <e32base.h>
#include <F32FILE.H>
#include <d32dbms.h>
#include <BADESCA.H>
#include <Etel3rdParty.h>
#include <MTCLREG.H>
class MImsiObserver
{
public: // New methods
virtual void GotIMSIL(const TDesC& aIMSI, TInt aError) = 0;
};
class CImsiReader : public CActive
{
public:
static CImsiReader* NewL(MImsiObserver* aObserver);
static CImsiReader* NewLC(MImsiObserver* aObserver);
~CImsiReader();
protected:
void DoCancel();
void RunL();
private:
CImsiReader(MImsiObserver* aObserver);
void ConstructL(void);
private:
MImsiObserver* iObserver;
CTelephony* iTelephony;
CTelephony::TSubscriberIdV1 iImsiV1;
CTelephony::TSubscriberIdV1Pckg iImsiV1Pkg;
};
See Also
- IMSI on Wikipedia
- Online tool to analyze IMSI
- DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [moved] How could i make sis file to work on 3rd edition mobiles? | hemrajn | Symbian Signing, Certification and Security | 6 | Today 12:27 |
| How to Get IMSI for Nokia 6600 | ramiqadi | General Symbian C++ | 3 | 2005-12-28 08:34 |
| Python for S60 3rd Edition | jplauril | Python | 82 | 2008-06-04 04:47 |
| App Common to series60 2'nd and 3'rd | anoopd | General Symbian C++ | 7 | 2007-04-13 07:42 |
| S60 3rd edition - getting started issue | Bill_Murray | General Symbian C++ | 5 | 2006-12-22 14:44 |
