Namespaces
Variants
Actions
Revision as of 08:01, 6 February 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to hold a call

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


65 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved