How to terminate call
Article Metadata
This is done using CTelephony using CTelephony::Hangup().
Pass the call ID to CTelephony::Hangup() to terminate the call. The ID is the CTelephony::TCallId returned when you dialled or answered the call.
Libraries Needed:
LIBRARY Etel3rdParty.lib euser.lib
Capabilities Needed:
CAPABILITY NetworkServices
Header
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TCallId iCallId;
public:
CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId);
void TerminateCall();
private:
void RunL();
void DoCancel();
};
Source
CClientApp::CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId)
: CActive(EPriorityStandard),
iTelephony(aTelephony),
iCallId(aCallId)
{
//Constructor
}
void CClientApp::TerminateCall()
{
iTelephony->Hangup(iStatus, iCallId);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
//The call has been terminated successfully;
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EHangupCancel);
}


(no comments yet)