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()
CTelephony
CTelephony::Hangup()
terminates
a call.
Pass it the ID of the call to terminate. The ID is the CTelephony::TCallId
returned
when you dialled or answered the call
CTelephony::EHangupCancel
to
cancel it
Use CTelephony::Hangup()
to terminate either call when
you have two call in progress. Pass it the ID of the call you wish to terminate.
To terminate them both, call the method twice with the two IDs.
#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); }