examples/Telephony/ETel3rdPartyExample/OutgoingCalls/CAnswerIncomingCall.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 #include "CAnswerIncomingCall.h"
00017 
00025 CAnswerIncomingCall* CAnswerIncomingCall::NewL(MExecAsync* aController)
00026         {
00027         CAnswerIncomingCall* self = new(ELeave) CAnswerIncomingCall(aController);
00028         CleanupStack::PushL(self);
00029         self->ConstructL();
00030         CleanupStack::Pop(self);
00031         return self;
00032         }
00033 
00038 CAnswerIncomingCall::~CAnswerIncomingCall()
00039         {
00040         Cancel();
00041         }
00042 
00046 void CAnswerIncomingCall::DoStartRequestL()
00047         {
00048         _LIT( KNotifyPanic, "CAnswerIncomingCall Get Method" );
00049         __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
00050         iRequestNotify = EFalse;
00051         
00052         // Answers an incoming new voice call.
00053         iTelephony->AnswerIncomingCall(iStatus, iCallId);
00054         SetActive();
00055         }
00056 
00063 CAnswerIncomingCall::CAnswerIncomingCall(MExecAsync* aController)
00064         : CISVAPIAsync(aController, KAnswerIncomingCall),
00065           iCallStatusV1Pckg( iCallStatusV1 )
00066         {
00067         // Empty method
00068         }
00069 
00073 void CAnswerIncomingCall::ConstructL()
00074         {
00075         iRequestNotify = EFalse;
00076         }
00077 
00082 void CAnswerIncomingCall::RunL()
00083         {
00084         if(iStatus != KErrNone)
00085                 {
00086                 iConsole->Printf(KError);
00087                 
00088                 // Print error status code
00089                 iConsole->Printf(_L("%d\n"), iStatus.Int());
00090                 }
00091         else
00092                 {
00093                 // Print the output to console if no error
00094                 iConsole->Printf(_L("Call Answered ....\n"));
00095                 ExampleComplete();
00096                 }
00097         }
00098 
00102 void CAnswerIncomingCall::DoCancel()
00103         {
00104         // Cancels an outstanding asynchronous request.
00105         iTelephony->CancelAsync(CTelephony::EAnswerIncomingCallCancel);
00106         }
00107 

Generated by  doxygen 1.6.2