Call Forward Status Tutorial

This tutorial describes how to get the call forward status information with the telephony API for applications.

Context

The call forward information is only available on the GSM and the WCDMA networks.

Steps

  1. create a new instance of [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelphony']]]CTelephony
  2. call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelphony']]]CTelephony::GetCallForwardingStatus() to get the call forward status information pass a [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelphony']]]CTelephony::TCallForwardingCondition object
  3. you can cancel the asynchronous request with a [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelphony']]]CTelephony::EGetCallForwardingStatusCancel enumeration.

Call forward status example

#include <e32base.h>
#include <Etel3rdParty.h>

class CClientApp : public CActive
    { 

private:
    CTelephony* iTelephony;
    CTelephony::TCallForwardingSupplServicesV1 iCallForwardingSupplServicesV1;
    CTelephony::TCallForwardingSupplServicesV1Pckg iCallForwardingSupplServicesV1Pckg;

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),
      iCallForwardingSupplServicesV1Pckg(iCallForwardingSupplServicesV1)
    {
    //default constructor
    }

void CClientApp::SomeFunction()
    {
    CTelephony::TCallForwardingCondition condition = CTelephony::ECallForwardingNoReply;
    iTelephony->GetCallForwardingStatus(iStatus, condition, iCallForwardingSupplServicesV1Pckg);
    SetActive();
    }

void CClientApp::RunL()
    {
    if(iStatus==KErrNone)
       {
       if( iCallForwardingSupplServicesV1.iCallForwarding == CTelephony::ENotActive )
          {} // The call forwarding condition is inactive; 
             // If the phone user does not answer a call then the call is _not_ forwarded
       }
    }

void CClientApp::DoCancel()
    {
    iTelephony->CancelAsync(CTelephony::EGetCallForwardingStatusCancel);
    }