cellularsrvapitest/telephonydevsoundhaitest/etelmm/src/T_RMobileConferenceCallData.cpp
author ivan.fildichev@opencode.com
Thu, 04 Nov 2010 20:30:45 +0200
branchopencode
changeset 85 96b4f933d69a
parent 24 6638e7f4bd8f
permissions -rw-r--r--
Bugfixes and added new tests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     1
/*
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     3
* All rights reserved.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     4
* This component and the accompanying materials are made available
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     6
* which accompanies this distribution, and is available
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     8
*
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
     9
* Initial Contributors:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    10
* Nokia Corporation - initial contribution.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    11
*
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    12
* Contributors:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    13
*
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    14
* Description:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    15
*
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    16
*/
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    17
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    18
#include "T_RMobileConferenceCallData.h"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    19
#include <e32property.h>
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    20
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    21
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    22
_LIT( KNumOfCalls,   	"NumOfCalls" );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    23
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    24
_LIT(KMobilePhoneKey, 	"RMobilePhone");
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    25
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    26
_LIT(KCmdClose, 					"Close");
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    27
_LIT(KCmdCreateConference, 			"CreateConference");
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    28
_LIT(KCmdEnumerateCalls, 			"EnumerateCalls");
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    29
_LIT(KCmdOpen, 						"Open");
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    30
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    31
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    32
 * Two phase constructor
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    33
 *
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    34
 * @leave	system wide error
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    35
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    36
CT_RMobileConferenceCallData* CT_RMobileConferenceCallData::NewL()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    37
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    38
	CT_RMobileConferenceCallData*	ret=new (ELeave) CT_RMobileConferenceCallData();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    39
	CleanupStack::PushL(ret);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    40
	ret->ConstructL();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    41
	CleanupStack::Pop(ret);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    42
	return ret;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    43
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    44
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    45
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    46
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    47
 * Protected constructor. First phase construction
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    48
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    49
CT_RMobileConferenceCallData::CT_RMobileConferenceCallData()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    50
:	iActiveCallback(NULL),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    51
	iMobileConferenceCall(NULL)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    52
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    53
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    54
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    55
void CT_RMobileConferenceCallData::ConstructL()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    56
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    57
	iMobileConferenceCall = new (ELeave) RMobileConferenceCall();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    58
	iActiveCallback = CActiveCallback::NewL(*this);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    59
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    60
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    61
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    62
 * Public destructor
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    63
 */
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    64
CT_RMobileConferenceCallData::~CT_RMobileConferenceCallData()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    65
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    66
	delete iMobileConferenceCall;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    67
	iMobileConferenceCall = NULL;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    68
	delete iActiveCallback;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    69
    iActiveCallback=NULL;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    70
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    71
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    72
TAny* CT_RMobileConferenceCallData::GetObject()	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    73
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    74
	return iMobileConferenceCall;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    75
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    76
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    77
void CT_RMobileConferenceCallData::RunL(CActive* aActive, TInt aIndex)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    78
    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    79
    DecOutstanding(); // One of the async calls has completed 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    80
    TInt err = aActive->iStatus.Int(); 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    81
    if( err != KErrNone ) 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    82
    	{ 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    83
        ERR_PRINTF2(_L("RunL Error %d"), err); 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    84
        SetAsyncError( aIndex, err ); 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    85
        } 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    86
    else 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    87
        { 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    88
        INFO_PRINTF1(_L("RunL  completed successfully")); 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    89
        } 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    90
    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    91
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    92
TBool CT_RMobileConferenceCallData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    93
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    94
	TBool ret = ETrue;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    95
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    96
	if ( aCommand==KCmdClose )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    97
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    98
		DoCmdClose();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
    99
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   100
	else if ( aCommand==KCmdCreateConference)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   101
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   102
		DoCmdCreateConference(aAsyncErrorIndex);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   103
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   104
	else if ( aCommand==KCmdEnumerateCalls)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   105
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   106
		DoCmdEnumerateCalls(aSection);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   107
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   108
	else if ( aCommand==KCmdOpen)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   109
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   110
		DoCmdOpen(aSection);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   111
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   112
	else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   113
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   114
		ERR_PRINTF1(_L("Unknown command"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   115
		ret = EFalse;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   116
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   117
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   118
	return ret;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   119
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   120
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   121
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   122
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   123
void CT_RMobileConferenceCallData::DoCmdClose()
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   124
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   125
	INFO_PRINTF1(_L("*START*CT_VoiceCallDriverData::DoCmdCloseConferenceCall"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   126
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   127
	iMobileConferenceCall->Close();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   128
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   129
    INFO_PRINTF1(_L("*END*CT_VoiceCallDriverData::DoCmdCloseConferenceCall"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   130
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   131
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   132
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   133
void CT_RMobileConferenceCallData::DoCmdCreateConference(const TInt aAsyncErrorIndex)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   134
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   135
	INFO_PRINTF1(_L("*START*CT_VoiceCallDriverData::DoCmdCreateConferenceCall"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   136
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   137
    iMobileConferenceCall->CreateConference(iActiveCallback->iStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   138
	iActiveCallback->Activate(aAsyncErrorIndex);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   139
    IncOutstanding();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   140
    
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   141
	INFO_PRINTF1(_L("*END*CT_VoiceCallDriverData::DoCmdCreateConferenceCall"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   142
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   143
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   144
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   145
void CT_RMobileConferenceCallData::DoCmdEnumerateCalls(const TTEFFunction& aSection)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   146
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   147
	INFO_PRINTF1(_L("*START*CT_VoiceCallDriverData::DoCmdEnumerateCallsOnConference"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   148
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   149
    TInt expectedCalls; 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   150
    if( !GetIntFromConfig(aSection, KNumOfCalls, expectedCalls) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   151
    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   152
    	ERR_PRINTF2(_L("Error in getting parameter %S from INI file"), &KNumOfCalls);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   153
    	SetBlockResult(EFail);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   154
    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   155
    else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   156
    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   157
	    INFO_PRINTF2(_L("Expecting conference call to contain [%d] calls"), expectedCalls);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   158
	    TInt calls(0);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   159
	    TRAPD( error, iMobileConferenceCall->EnumerateCalls(calls) );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   160
	    if(error != KErrNone)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   161
	    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   162
	    	ERR_PRINTF2(_L("Failed to enumerate calls with error %d"), error);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   163
	    	SetError(error);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   164
	    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   165
	    else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   166
	    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   167
		    INFO_PRINTF2(_L("Conference contained [%d] calls"), calls);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   168
		    if (expectedCalls != calls)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   169
		        {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   170
		        ERR_PRINTF3(_L("Obtained number of calls %d is different from expected number of calls %d"), calls, expectedCalls);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   171
		    	SetBlockResult(EFail);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   172
		        }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   173
		    else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   174
		    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   175
		    	INFO_PRINTF1(_L("DoCmdEnumerateCallsOnConference succeeded"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   176
		    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   177
	    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   178
    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   179
    INFO_PRINTF1(_L("*END*CT_VoiceCallDriverData::DoCmdEnumerateCallsOnConference"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   180
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   181
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   182
void CT_RMobileConferenceCallData::DoCmdOpen(const TTEFFunction& aSection)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   183
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   184
	INFO_PRINTF1(_L("*START*CT_VoiceCallDriverData::DoCmdOpenConferenceCall"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   185
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   186
	TPtrC mobilePhoneName;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   187
	if( !GetStringFromConfig(aSection, KMobilePhoneKey, mobilePhoneName))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   188
    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   189
    	ERR_PRINTF2(_L("Error in getting parameter %S from INI file"), &KMobilePhoneKey);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   190
    	SetBlockResult(EFail);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   191
    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   192
	else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   193
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   194
		RMobilePhone* MobilePhoneObject = static_cast<RMobilePhone*>(GetDataObjectL(mobilePhoneName));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   195
		TRAPD( error, iMobileConferenceCall->Open(*MobilePhoneObject) );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   196
	    if (error != KErrNone)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   197
	        {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   198
	        ERR_PRINTF2(_L("Conference call open failed [%d]"), error);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   199
	    	SetError(error);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   200
	        }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   201
	    else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   202
	    	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   203
	    	INFO_PRINTF1(_L("DoCmdOpenConferenceCall succeeded"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   204
	    	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   205
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   206
    INFO_PRINTF1(_L("*END*CT_VoiceCallDriverData::DoCmdOpenConferenceCall"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   207
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   208
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 0
diff changeset
   209