Call Forward Status Tutorial

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

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


  1. create a new instance of CTelephony

  2. call CTelephony::GetCallForwardingStatus() to get the call forward status information pass a CTelephony::TCallForwardingCondition object

  3. you can cancel the asynchronous request with a 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);
    }