examples/Telephony/ETel3rdPartyExample/OutgoingCalls/CDialCall.cpp

00001 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 
00017 #include "CDialCall.h"
00018 
00026 CDialCall* CDialCall::NewL(MExecAsync* aController)
00027         {
00028         CDialCall* self = new(ELeave) CDialCall(aController);
00029         CleanupStack::PushL(self);
00030         self->ConstructL();
00031         CleanupStack::Pop(self);
00032         return self;
00033         }
00034 
00039 CDialCall::~CDialCall()
00040         {
00041         Cancel();
00042         }
00043 
00049 void CDialCall::DoStartRequestL(const TDesC& aNumber)
00050         {
00051         CTelephony::TCallParamsV1 callParams;
00052         callParams.iIdRestrict = CTelephony::ESendMyId;
00053         CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
00054         iConsole->Printf(_L("Dialling "));
00055         
00056         // Print the number to dial
00057         iConsole->Printf(aNumber);
00058         iConsole->Printf(KNewLine);
00059         
00060         // Initiates a new call.
00061         iTelephony->DialNewCall(iStatus, callParamsPckg, aNumber, iCallId);
00062         SetActive();
00063         }
00064 
00071 CDialCall::CDialCall(MExecAsync* aController)
00072         : CISVAPIAsync(aController, KDialCall)
00073         {
00074         // Empty method
00075         }
00076 
00080 void CDialCall::ConstructL()
00081         {
00082         // Empty method
00083         }
00084 
00089 void CDialCall::RunL()
00090         {
00091         if(iStatus != KErrNone)
00092                 {
00093                 iConsole->Printf(KError);
00094                 
00095                 // Print the error status code
00096                 iConsole->Printf(_L("%d\n"), iStatus.Int());
00097                 }
00098         else
00099                 {
00100                 ExampleComplete();
00101                 }
00102         }
00103 
00107 void CDialCall::DoCancel()
00108         {
00109         // Cancels an outstanding asynchronous request
00110         iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
00111         }

Generated by  doxygen 1.6.2