Call in Progress Tutorial

This tutorial describes how to get the call progress with the telephony API for applications.

Context

The client applications can determine the status of voice, data and fax calls with the CTelephony functions.

Steps

  1. create a new instance of [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony
  2. use[[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::GetIndicator() to get the call progress information The function returns a [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]TIndicatorV1 object that contains the call progress information
  3. pass the enumeration [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::EGetIndicatorCancel to cancel the aynchronous request
  4. use [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::EIndicatorChange to get the notification of any changes in the call progress information
  5. pass the enumeration [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CTelephony']]]CTelephony::EIndicatorChangeCancel to cancel the notification request

Call in progress example

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

class CClientApp : public CActive
    { 

private:
    CTelephony* iTelephony;
    CTelephony::TIndicatorV1 iIndicatorV1;
    CTelephony::TIndicatorV1Pckg iIndicatorV1Pckg;

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

void CClientApp::SomeFunction()
    {
    iTelephony->GetIndicator(iStatus, iIndicatorV1Pckg);
    SetActive();
    }

void CClientApp::RunL()
    {
    if(iStatus==KErrNone)
       {
       if(iIndicatorV1.iCapabilities & CTelephony::KIndCallInProgress)
          {
          // We can detect when a call is in progress
          if(iIndicatorV1.iIndicator & CTelephony::KIndCallInProgress)
             {} // A call is in progress
          else
             {} // A call is not in progress
          }
       else
          {} // We do not know whether a call is in progress
       }
    }

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