×
Namespaces

Variants
Actions

How to hold a call

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: polaka_sr (30 Dec 2007)
Last edited: hamishwillee (06 Feb 2012)

To hold a call we can use CTelephony::Hold(). Pass the call ID to CTelephony::Hold(). The ID is the CTelephony::TCallId returned when you dialled or answered the call.

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

Since, this is done using an asynchronous call, one can cancel this using CTelephony::EHoldCancel.


#include <e32base.h>
#include <Etel3rdParty.h>
 
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TCallId iCallId;
 
public:
CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId);
TInt HoldCall();
 
private:
void RunL();
void DoCancel();
};
 
CClientApp::CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId)
: CActive(EPriorityStandard),
iTelephony(aTelephony),
iCallId(aCallId)
{
//Constructor
}
 
TInt CClientApp::HoldCall()
{
//Check that the phone supports holding calls.
CTelephony::TCallCapsV1 callCapsV1;
CTelephony::TCallCapsV1Pckg callCapsV1Pckg(callCapsV1);
iTelephony->GetCallDynamicCaps(iCallId, callCapsV1Pckg);
 
if( callCapsV1.iControlCaps & CTelephony::KCapsHold )
{
//The call represented by 'iCallId' can be put on hold
iTelephony->Hold(iStatus, iCallId);
SetActive();
return KErrNone;
}
else
{
//The call cannot be put on hold;
//Return an error indicate this.
return KErrNotSupported;
}
}
 
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
//The call has been held successfully;
}
}
 
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EHoldCancel);
}





Wiki Internal Links


This page was last modified on 6 February 2012, at 08:01.
42 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×