This tutorial describes how to dial a call with the telephony API for applications.
This example dials the number 123456789 and allows the remote party to see the phone's number:
#include <e32base.h> #include <Etel3rdParty.h> _LIT(KTheNumber, "123456789"); class CClientApp : public CActive { private: CTelephony* iTelephony; CTelephony::TCallId iCallId; public: CClientApp(CTelephony* aTelephony); 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) : CActive(EPriorityStandard), iTelephony(aTelephony) { //default constructor } void CClientApp::SomeFunction() { CTelephony::TTelNumber telNumber(KTheNumber); CTelephony::TCallParamsV1 callParams; callParams.iIdRestrict = CTelephony::ESendMyId; CTelephony::TCallParamsV1Pckg callParamsPckg(callParams); iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId); SetActive(); } void CClientApp::RunL() { if(iStatus==KErrNone) {} // The call has been dialled successfully; // iCallId contains the call's ID, needed when controlling the call. } void CClientApp::DoCancel() { iTelephony->CancelAsync(CTelephony::EDialNewCallCancel); }
This describes how to dial a second call while another is in progress.
Put the first call on hold.
For more information. See Call Hold Tutorial .
If the first call was not dialled or answered by you then you cannot control it, and so you cannot put it on hold. If it is not on hold already then you will have to wait until the it is put on hold. The Voice line status changes to CTelephony::EStatusHold .
Dial the second call.
This is the same as dialling a call in the Dial a Call Tutorial . CTelephony::AnswerIncomingCall() will return a different call ID to the first call.
Remember that to dial a call is an asynchronous operation.
If the operation fails, remember to resume the first call, see Call Resume Tutorial .
As a result, the first call is on hold, and the phone user is connected to the second caller.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.