Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 08:31, 4 January 2008.

How to detect remote party terminating a call

From Forum Nokia Wiki

CTelephony::NotifyChange() is used to detect changes in the voice line's status.This starts an asynchronous operation that completes when the calls's status changes. The call's new status is written into the CTelephony::TCallStatusV1Pckg.

CTelephony represents the status of your calls with a CTelephony::TCallStatus. Possible status values include Idle, Ringing, On-Hold etc:

  • When a call's status changes from CTelephony::EStatusConnected to CTelephony::EStatusIdle then the call has terminated.
  • When a call's status changes from CTelephony::EStatusHold to CTelephony::EStatusIdle then the call has terminated.


  • Libraries Needed: Etel3rdParty.lib and euser.lib
  • Asynchronous call


#include <e32base.h>
#include <Etel3rdParty.h>
 
class CClientApp : public CActive
    {
 
private:
    CTelephony* iTelephony;
    CTelephony::TCallId iCallId;
                CTelephony::TCallStatusV1 iCallStatusV1;
                CTelephony::TCallStatusV1Pckg iCallStatusV1Pckg;
    CTelephony::TNotificationEvent iEvent;
 
public:
    CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId);
    TInt DetectRemoteTerminate();
 
private:
    void RunL();
    void DoCancel();
   };
 
CClientApp::CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId)
    : CActive(EPriorityStandard),
      iTelephony(aTelephony),
      iCallId(aCallId),
      iCallStatusV1Pckg(iCallStatusV1)
    {
       //Constructor
    }
 
TInt CClientApp::DetectRemoteTerminate()
    {
    switch(iCallId)
       {
       case CTelephony::EISVCall1:
          iEvent = CTelephony::EOwnedCall1StatusChange;
          break;
 
       case CTelephony::EISVCall2:
          iEvent = CTelephony::EOwnedCall2StatusChange;
          break;
 
       default:
          //We haven't given a valid call ID here, so return an error
          return KErrArgument;
       }
 
    iTelephony->NotifyChange(iStatus, iEvent, iCallStatusV1Pckg);
    SetActive();
    return KErrNone;
    }
 
void CClientApp::RunL()
    {
    if(iStatus==KErrNone)
       {
       //The status of the call has changed.
       if(iCallStatusV1.iStatus == CTelephony::EStatusIdle)
          {
             //The call has been terminated.
          }
       else
          {
          //The call has not yet been terminated, so request notification again
          iTelephony->NotifyChange(iStatus, iEvent, iCallStatusV1Pckg);
          SetActive();
          }
       }
    }
 
void CClientApp::DoCancel()
    {
    CTelephony::TCancellationRequest cancelRequest;
    if(iCallId == CTelephony::EISVCall1)
       {
       cancelRequest = CTelephony::EOwnedCall1StatusChangeCancel;
       }
    else //iCallId == CTelephony::EISVCall2
       {
       cancelRequest = CTelephony::EOwnedCall2StatusChangeCancel;
       }
    iTelephony->CancelAsync(cancelRequest);
    }





Wiki Internal Links


Related Discussions
Thread Thread Starter Forum Replies Last Post
Why does the Originating Emulator close by itself!!! yingxiuzh General Messaging 1 2002-08-02 10:21
outgoing call related issues white_dragon General Symbian C++ 3 2007-08-03 07:26
How to add bookmark/detect browser type? siutung Browsing and Mark-ups 1 2006-10-25 18:30
Simple APS related question totoroasis General Symbian C++ 2 2007-08-08 06:05
MMA: Exception during remote invocation brokendove Mobile Java General 0 2006-06-05 10:02
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX