This tutorial describes how to terminate a call with the telephony API for applications.
terminate an on-hold call and then you will be left with an active call
terminate an active call and then you will be left with a call on hold; the on-hold call does not become active. You can make it active with CTelephony::Resume()
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TCallId iCallId;
public:
CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId);
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, CTelephony::TCallId aCallId)
: CActive(EPriorityStandard),
iTelephony(aTelephony),
iCallId(aCallId)
{
//default constructor
}
void CClientApp::SomeFunction()
{
iTelephony->Hangup(iStatus, iCallId);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{} // The call has been terminted successfully;
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EHangupCancel);
}
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.