Caller Identification Status Tutorial

This tutorial describes how to get the caller identification status information with the telephony API for applications.

Context

The caller identification service is available only on GSM and WCDMA networks.

The steps to get the caller identification status information are:

Steps

  1. create a new instance of [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony
  2. call [[[ERROR: [NOKX000E] Unable to find definition for key reference '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
  3. 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']]]EIdServiceCallerRestriction to with hold the number
  4. pass the enumeration[[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]EGetIdentityServiceStatusCancel to the to cancel the asynchronous request.

Caller identification status example

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);
    }