This tutorial describes how to get the caller identification status information with the telephony API for applications.
The caller identification service is available only on GSM and WCDMA networks.
The steps to get the caller identification status information are:
CTelephony
CTelephony::GetIdentityServiceStatus()
to
get the caller identification service status information
Pass a [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]TIdentityService
object
with [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]EIdServiceCallerPresentation
TIdentityService
object
with [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]EIdServiceCallerRestriction
to
with hold the number
EGetIdentityServiceStatusCancel
to
the to cancel the asynchronous request.
Example code to get the caller identification status.
#include <e32base.h> #include <Etel3rdParty.h> class CClientApp : public CActive { private: CTelephony* iTelephony; CTelephony::TIdentityServiceV1 iTIdentityServiceV1; CTelephony::TIdentityServiceV1Pckg iTIdentityServiceV1Pckg; public: CClientApp(CTelephony* aTelephony); void SomeFunction(); private: /* These are the pure virtual methods from CActive that MUST be implemented by all active objects */ void RunL(); void DoCancel(); }; CClientApp::CClientApp(CTelephony* aTelephony) : CActive(EPriorityStandard), iTelephony(aTelephony), iTIdentityServiceV1Pckg(iTIdentityServiceV1) { //default constructor } void CClientApp::SomeFunction() { CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerPresentation; iTelephony->GetIdentityServiceStatus(iStatus, condition, iTIdentityServiceV1Pckg); SetActive(); } void CClientApp::RunL() { if(iStatus==KErrNone) { if( iTIdentityServiceV1.iIdentityStatus == CTelephony::EIdServiceActivePermanent ) {} // CLIP is permanently active; // Your phone will display the callers number whenever this is allowed by the caller } } void CClientApp::DoCancel() { iTelephony->CancelAsync(CTelephony::EGetIdentityServiceStatusCancel); }