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); }