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 TIdentityService
object
with EIdServiceCallerPresentation
TIdentityService
object
with 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); }