telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestcallemergency.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Test step definitions for the CallEmergency functional unit.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalTechnology
       
    20 */
       
    21 
       
    22 #include "cctsyintegrationtestcallemergency.h"
       
    23 #include "cctsyinidata.h"
       
    24 
       
    25 const RMobilePhone::TMobilePassword KAltWrongPin = _L("abcd");
       
    26 _LIT(KEmergencyNumber112,"112");
       
    27 _LIT(KEmergencyNumber999,"999");
       
    28 _LIT(KEmergencyNumber110,"110");
       
    29 _LIT(KEmergencyNumber118,"118");
       
    30 _LIT(KEmergencyNumber119,"119");
       
    31 _LIT(KEmergencyNumber08,"08");
       
    32 _LIT(KEmergencyNumber000,"000");
       
    33 
       
    34 	
       
    35 CCTSYIntegrationTestCallEmergencyBase::CCTSYIntegrationTestCallEmergencyBase(CEtelSessionMgr& aEtelSessionMgr)
       
    36 	: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iNetworkTestHelper(*this), iPhoneTestHelper(*this), iCallControlTestHelper(*this)
       
    37 /**
       
    38  * Constructor
       
    39  */
       
    40 	{
       
    41 	}
       
    42 
       
    43 CCTSYIntegrationTestCallEmergencyBase::~CCTSYIntegrationTestCallEmergencyBase()
       
    44 /*
       
    45  * Destructor
       
    46  */
       
    47 	{
       
    48 	}
       
    49 
       
    50 
       
    51 
       
    52 
       
    53 void CCTSYIntegrationTestCallEmergencyBase::MakeEmergencyCallL(RMobileCall& aCall, const TDesC& aNumber)
       
    54 /**
       
    55  * Dials emergency call, checks it is successful, check the status of the call and hangs up
       
    56  * @param aCall Handle to RMobileCall object
       
    57  * @param aNumber number to be dialled.
       
    58  * 
       
    59  * @return void
       
    60  */
       
    61     {
       
    62 	
       
    63 	DEBUG_PRINTF2(_L("Dialing to emergency number: %S"),&aNumber);
       
    64 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange
       
    65 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
    66 	TExtEtelRequestStatus notifyCallStatusChange(aCall, EMobileCallNotifyMobileCallStatusChange);
       
    67 	CleanupStack::PushL(notifyCallStatusChange);
       
    68 	aCall.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
    69 
       
    70 	// Dial RMobileCall::DialEmergencyCall with aNumber 
       
    71 	TExtEtelRequestStatus dialStatus(aCall, EMobileCallDialEmergencyCall);
       
    72 	CleanupStack::PushL(dialStatus);
       
    73 	aCall.DialEmergencyCall(dialStatus, aNumber);
       
    74 	
       
    75 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeVeryLong), KErrNone,  _L("RMobileCall::DialEmergencyCall timed-out"));
       
    76 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall returned an error"));
       
    77 	
       
    78 	// ===  Check mobile call status ===
       
    79 
       
    80 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
    81 	RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
    82 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
    83 																		notifyCallStatusChange,
       
    84 																		mobileCallStatus,
       
    85 																		expectedMobileCallStatus,
       
    86 																		KErrNone);
       
    87 	// Repost notifier
       
    88 	aCall.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
    89 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
    90 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
    91 																		notifyCallStatusChange,
       
    92 																		mobileCallStatus,
       
    93 																		expectedMobileCallStatus,
       
    94 																		KErrNone);
       
    95 	// Repost notifier
       
    96 	aCall.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
    97 	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
    98 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
    99 																		notifyCallStatusChange,
       
   100 																		mobileCallStatus,
       
   101 																		expectedMobileCallStatus,
       
   102 																		KErrNone);																	
       
   103 																		
       
   104 	// Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected.
       
   105 	ASSERT_EQUALS(aCall.GetMobileCallStatus(mobileCallStatus), KErrNone, _L("RMobileCall::GetMobileCallStatus returned an error"));
       
   106 	ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, _L("RMobileCall::GetMobileCallStatus did not return EStatusIdle"));
       
   107 			
       
   108 	// Hang up. 
       
   109 	TCoreEtelRequestStatus<RMobileCall> hangUpStatus (aCall, &RCall::HangUpCancel);	
       
   110 	CleanupStack::PushL(hangUpStatus);
       
   111 	aCall.HangUp(hangUpStatus);
       
   112 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeLong), KErrNone, _L("RCall::HangUp timed-out"));
       
   113 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned an error"));	
       
   114 	aCall.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
   115 	expectedMobileCallStatus = RMobileCall::EStatusIdle;
       
   116 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   117 																		notifyCallStatusChange,
       
   118 																		mobileCallStatus,
       
   119 																		expectedMobileCallStatus,
       
   120 																		KErrNone);																	
       
   121 	
       
   122 	// Pop
       
   123 	// notifyCallStatusChange
       
   124 	// dialStatus
       
   125 	// hangUpStatus	
       
   126 	CleanupStack::PopAndDestroy(3, &notifyCallStatusChange);
       
   127 	
       
   128 }
       
   129 
       
   130 
       
   131 
       
   132 
       
   133 CCTSYIntegrationTestCallEmergency0001::CCTSYIntegrationTestCallEmergency0001(CEtelSessionMgr& aEtelSessionMgr)
       
   134 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
   135 /**
       
   136  * Constructor.
       
   137  */
       
   138 	{
       
   139 	SetTestStepName(CCTSYIntegrationTestCallEmergency0001::GetTestStepName());
       
   140 	}
       
   141 
       
   142 CCTSYIntegrationTestCallEmergency0001::~CCTSYIntegrationTestCallEmergency0001()
       
   143 /**
       
   144  * Destructor.
       
   145  */
       
   146 	{
       
   147 	}
       
   148 
       
   149 TVerdict CCTSYIntegrationTestCallEmergency0001::doTestStepL()
       
   150 /**
       
   151  * @SYMTestCaseID BA-CTSY-INT-CEMG-0001
       
   152  * @SYMFssID BA/CTSY/CEMG-0001
       
   153  * @SYMTestCaseDesc Dial an emergency call (with international emergency number) using SIM/USIM with no emergency numbers stored on it.
       
   154 
       
   155  * @SYMTestPriority High
       
   156  * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::NotifySecurityEvent, RMobilePhone::SetFdnSetting, RCall::HangUp, RMobileCall::GetMobileCallStatus, RMobileCall::DialEmergencyCall, RMobileCall::GetMobileCallInfo
       
   157  * @SYMTestExpectedResults Pass - Call to international emergency numbers can be made.
       
   158  * @SYMTestType CIT
       
   159  * @SYMTestCaseDependencies simulated/manual
       
   160  *
       
   161  * Reason for test: Verify national and international emergency numbers can be dialled with and without FDN active including when phone is in forbidden PLMN.
       
   162  *
       
   163  * @return - TVerdict code
       
   164  */
       
   165 	{
       
   166 
       
   167 	//
       
   168 	// SET UP
       
   169 	//
       
   170 
       
   171 
       
   172     // Check that the phone is registered with the network simulator. 
       
   173     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   174 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   175 	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
   176 
       
   177 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
   178 	TUint32 securityCaps;
       
   179 	CHECK_EQUALS_L(phone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
   180 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps did not return KCapsAccessPin2 bits"));
       
   181 
       
   182     // get network operator information
       
   183 	const TDesC* networkSection = NULL;
       
   184 	iNetworkTestHelper.GetNetworkPasswordsSectionL(phone, networkSection);
       
   185 
       
   186 	// Get the password from the ini file
       
   187 	TPtrC pin2; 
       
   188 	CHECK_TRUE_L(GetStringFromConfig(*networkSection, KIniPin2, pin2) != EFalse, _L("GetStringFromConfig returned with an error"));
       
   189 
       
   190 	// Lock PIN2 with RMobilePhone::SetLockSetting with aLock=ELockPin2, aSetting=ELockSetEnabled
       
   191 	// $CTSYProblem RMobilePhone::SetLockSetting returns KErrNotSupported from LTSY.
       
   192 	iPhoneTestHelper.ChangePhoneLockSettingL(phone, RMobilePhone::ELockPin2, RMobilePhone::ELockSetEnabled, pin2, KErrNotSupported);
       
   193 
       
   194 	// Ensure RMobilePhone::GetLockInfo aLock=ELockPin2 returns TMobilePhoneLockInfoV1::iStatus=EStatusLocked and TMobilePhoneLockInfoV1::iSetting = ELockSetEnabled 
       
   195 	RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
       
   196 	RMobilePhone::TMobilePhoneLockInfoV1Pckg infoPckg(lockInfo);
       
   197 	TExtEtelRequestStatus getLockInfoStatus(phone, EMobilePhoneGetLockInfo);
       
   198 	CleanupStack::PushL(getLockInfoStatus);
       
   199 	phone.GetLockInfo(getLockInfoStatus, RMobilePhone::ELockPin2, infoPckg);
       
   200 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getLockInfoStatus, ETimeLong), KErrNone, _L("RMobilePhone::GetLockInfo timed out"));
       
   201 	CHECK_EQUALS_L(getLockInfoStatus.Int(), KErrNone, _L("RMobilePhone::GetLockInfo returned an error"));
       
   202 	CHECK_EQUALS_L(lockInfo.iStatus, RMobilePhone::EStatusLocked, _L("RMobilePhone::GetLockInfo did not returned iStatus = RMobilePhone::EStatusLocked"));
       
   203 	CHECK_EQUALS_L(lockInfo.iSetting, RMobilePhone::ELockSetEnabled, _L("RMobilePhone::GetLockInfo did not returned iSetting = RMobilePhone::ELockSetEnabled"));
       
   204 
       
   205 	// Ensure the FDN is deactivated (RMobilePhone::GetFdnStatus returns EFdnNotActive) 
       
   206 	RMobilePhone::TMobilePassword pin2Password;
       
   207 	pin2Password.Copy(pin2);
       
   208 	RMobilePhone::TMobilePhoneFdnStatus fdnStatus;
       
   209 	CHECK_EQUALS_L(phone.GetFdnStatus(fdnStatus), KErrNone, _L("RMobilePhone::GetFdnStatus returned an error"));
       
   210     
       
   211     if(fdnStatus != RMobilePhone::EFdnNotActive)
       
   212         {
       
   213         CHECK_EQUALS_L(iPhoneTestHelper.SetPhoneFdnSettingL(phone, pin2Password, RMobilePhone::EFdnSetOff), KErrNone,_L("RMobilePhone::SetFdnSetting failed"));
       
   214         CHECK_EQUALS_L(phone.GetFdnStatus(fdnStatus), KErrNone, _L("RMobilePhone::GetFdnStatus returned an error"));
       
   215         }
       
   216 
       
   217 	CHECK_EQUALS_L(fdnStatus, RMobilePhone::EFdnNotActive, _L("RMobilePhone::GetFdnStatus did not return EfdnNotActive."));
       
   218 
       
   219     // Get server
       
   220     RTelServer& telServer = iEtelSessionMgr.GetServerL(KMainServer);
       
   221 
       
   222 	// Get voice line 1. 
       
   223 	RMobileLine& mobileLine= iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
   224 
       
   225 	// Get call 1. 
       
   226 	RMobileCall& mobileCall= iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine, KCall1);
       
   227 
       
   228 
       
   229 	//
       
   230 	// SET UP END
       
   231 	//
       
   232 	
       
   233 	StartTest();
       
   234 	
       
   235 	//
       
   236 	// TEST START
       
   237 	//
       
   238 	
       
   239 	// Dial an emergency call 112
       
   240     DoTest0001L(phone, mobileCall, KEmergencyNumber112, pin2Password);
       
   241 	// Repeat whole test dialling 999 instead of 112.
       
   242     DoTest0001L(phone, mobileCall, KEmergencyNumber999, pin2Password);
       
   243 
       
   244 	// Repeat whole test with both numbers with simulator simulating phone not camped on suitable cell (forbidden PLMN). 
       
   245 	TExtEtelRequestStatus reqStatus(phone, EMobilePhoneNotifyNetworkRegistrationStatusChange );
       
   246 	CleanupStack::PushL(reqStatus);
       
   247 	RMobilePhone::TMobilePhoneRegistrationStatus registrationStatus;
       
   248 	phone.NotifyNetworkRegistrationStatusChange(reqStatus, registrationStatus);
       
   249 	DisplayUserInteractionPromptL(_L("Make sure phone is not camped on suitable cell (forbidden PLMN)"), ETimeLong);
       
   250 	TInt err = WaitForRequestWithTimeOut(reqStatus,ETimeVeryLong);
       
   251 	while (	(err == KErrNone) && (reqStatus.Int() == KErrNone) && (registrationStatus == RMobilePhone::ENotRegisteredSearching ) )
       
   252 		{
       
   253 		phone.NotifyNetworkRegistrationStatusChange(reqStatus, registrationStatus);
       
   254 		err = WaitForRequestWithTimeOut(reqStatus,ETimeVeryLong);
       
   255 		}
       
   256 	DEBUG_PRINTF2(_L(" Network  registration status  = %d"), registrationStatus);
       
   257     DoTest0001L(phone, mobileCall, KEmergencyNumber112, pin2Password);
       
   258     DoTest0001L(phone, mobileCall, KEmergencyNumber999, pin2Password);
       
   259 
       
   260 	
       
   261 	//
       
   262 	// TEST END
       
   263 	//
       
   264 
       
   265     StartCleanup();
       
   266 	
       
   267 	// Pop:
       
   268 	//	reqStatus
       
   269 	//	getLockInfoStatus
       
   270 	CleanupStack::PopAndDestroy(2,&getLockInfoStatus);
       
   271    
       
   272    return TestStepResult();
       
   273     }
       
   274 
       
   275 
       
   276 void CCTSYIntegrationTestCallEmergency0001::DoTest0001L(RMobilePhone &aPhone,
       
   277                                                         RMobileCall& aCall,
       
   278                                                         const TDesC& aNumber,
       
   279                                                         RMobilePhone::TMobilePassword& aPIN2Password)
       
   280 /**
       
   281  * Function for dialling an emergency call. This is a helper method for repeating emergency calls in test 0001.
       
   282  * 
       
   283  * @param aPhone a reference to RMobilePhone object
       
   284  * @param aCall a reference to RMobileCall object
       
   285  * @param aNumber TDesC holding the emergecy number
       
   286  * @param aPIN2Password TMobilePassword holding the PIN2 password
       
   287 
       
   288  * @return void
       
   289  */
       
   290 	{
       
   291 	// Set priority client with RTelServer::SetPriorityClientV2
       
   292 	// $CTSYProblem Can't set client priority, ETEL returns KErrPermissionDenied  
       
   293 
       
   294 	// Post Notifier for RMobileCall::NotifyMobileCallStatusChange
       
   295 	TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(aCall, EMobileCallNotifyMobileCallStatusChange);
       
   296 	CleanupStack::PushL(notifyMobileCallStatusChangeStatus);
       
   297 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
   298 	aCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   299 
       
   300 	// Dial RMobileCall::DialEmergencyCall with aNumber 
       
   301 	DEBUG_PRINTF2(_L("Board Now Dialling: %S"),&aNumber);
       
   302 	TExtEtelRequestStatus dialStatus(aCall, EMobileCallDialEmergencyCall);
       
   303 	CleanupStack::PushL(dialStatus);
       
   304 	aCall.DialEmergencyCall(dialStatus, aNumber); 
       
   305 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::DialEmergencyCall timed-out"));
       
   306 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall returned with an error"));
       
   307 
       
   308 	// ===  Check mobile call status ===
       
   309 
       
   310 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
   311 	RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
   312 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   313 															notifyMobileCallStatusChangeStatus,
       
   314 															mobileCallStatus,
       
   315 															expectedMobileCallStatus,
       
   316 															KErrNone);
       
   317 
       
   318 	aCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   319 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
   320 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   321 															notifyMobileCallStatusChangeStatus,
       
   322 															mobileCallStatus,
       
   323 															expectedMobileCallStatus,
       
   324 															KErrNone);
       
   325 
       
   326 	aCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   327 	expectedMobileCallStatus = RMobileCall::EStatusConnected;															
       
   328 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   329 															notifyMobileCallStatusChangeStatus,
       
   330 															mobileCallStatus,
       
   331 															expectedMobileCallStatus,
       
   332 															KErrNone);
       
   333 
       
   334 	// Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected.
       
   335 	ASSERT_EQUALS(aCall.GetMobileCallStatus(mobileCallStatus), KErrNone,  _L("RMobileCall::GetMobileStatus returned an error."));
       
   336 	ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, _L("RMobileCall::GetMobileStatus did not return EStatusConnected."));
       
   337 
       
   338 	// ===  Check call info ===
       
   339 
       
   340 	// Check RMobileCall::GetMobileCallInfo returns valid call name.
       
   341 	RMobileCall::TMobileCallInfoV1 mobileCallInfo;
       
   342 	RMobileCall::TMobileCallInfoV1Pckg mobileCallInfoPckg(mobileCallInfo);
       
   343 	ASSERT_EQUALS(aCall.GetMobileCallInfo(mobileCallInfoPckg), KErrNone, _L("RMobileCall::GetMobileCallInfo returned an error"));
       
   344 	ASSERT_TRUE(mobileCallInfo.iCallName.Length() > 0, _L("RMobileCall::GetMobileCallInfo returned an invalid call name"));
       
   345 
       
   346 	// Check RMobileCall::GetMobileCallInfo returns valid line name.
       
   347 	ASSERT_TRUE(mobileCallInfo.iLineName.Length() > 0, _L("RMobileCall::GetMobileCallInfo returned an invalid line name"));
       
   348 
       
   349 	// Check RMobileCall::GetMobileCallInfo returns iDialledParty = 112
       
   350 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10064 );
       
   351 	ASSERT_EQUALS_DES16(mobileCallInfo.iDialledParty.iTelNumber, aNumber, _L("RMobileCall::GetMobileCallInfo returned an invalid number"));
       
   352 
       
   353 	// Check RMobileCall::GetMobileCallInfo returns iEmergency = ETrue
       
   354 	ASSERT_TRUE(mobileCallInfo.iEmergency, _L("RMobileCall::GetMobileCallInfo did not return ETrue for iEmergency"));
       
   355 
       
   356 	// Hang up with RCall::HangUp 
       
   357 	TCoreEtelRequestStatus<RMobileCall> hangUpStatus (aCall, &RCall::HangUpCancel);	
       
   358 	CleanupStack::PushL(hangUpStatus);
       
   359 	aCall.HangUp(hangUpStatus);
       
   360 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeLong), KErrNone, _L("RCall::HangUp timed-out"));
       
   361 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned an error"));	
       
   362 
       
   363 	// ===  Activate the FDN ===
       
   364 
       
   365 	// Call RMobilePhone::SetFdnSetting with RMobilePhone::EFdnSetOn 
       
   366     TInt err = iPhoneTestHelper.SetPhoneFdnSettingL(aPhone, aPIN2Password, RMobilePhone::EFdnSetOn);
       
   367 
       
   368 	// Check RMobilePhone::SetFdnSetting completes with KErrNone
       
   369     ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::SetFdnSetting returned an error"));
       
   370 
       
   371     // Repost notifier for RMobileCall::NotifyMobileCallStatusChange
       
   372 	aCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   373 
       
   374 	// Dial RMobileCall::DialEmergencyCall with aNumber=112 
       
   375 	aCall.DialEmergencyCall(dialStatus, aNumber); 
       
   376 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::DialEmergencyCall timed-out"));
       
   377 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall returned with an error"));
       
   378 
       
   379 	// ===  Check mobile call status ===
       
   380 
       
   381 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
   382 	expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
   383 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   384 															notifyMobileCallStatusChangeStatus,
       
   385 															mobileCallStatus,
       
   386 															expectedMobileCallStatus,
       
   387 															KErrNone);
       
   388 
       
   389 	aCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   390 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
   391 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   392 															notifyMobileCallStatusChangeStatus,
       
   393 															mobileCallStatus,
       
   394 															expectedMobileCallStatus,
       
   395 															KErrNone);
       
   396 
       
   397 	aCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   398 	expectedMobileCallStatus = RMobileCall::EStatusConnected;															
       
   399 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(aCall,
       
   400 															notifyMobileCallStatusChangeStatus,
       
   401 															mobileCallStatus,
       
   402 															expectedMobileCallStatus,
       
   403 															KErrNone);
       
   404 
       
   405 	// Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected.
       
   406 	ASSERT_EQUALS(aCall.GetMobileCallStatus(mobileCallStatus), KErrNone,  _L("RMobileCall::GetMobileStatus returned an error."));
       
   407 	ASSERT_EQUALS(mobileCallStatus, RMobileCall::EStatusConnected, _L("RMobileCall::GetMobileStatus did not return status EStatusConnected."));
       
   408 
       
   409 	// Check RMobileCall::GetMobileCallInfo returns iValid of 0.
       
   410 	ASSERT_EQUALS(aCall.GetMobileCallInfo(mobileCallInfoPckg), KErrNone, _L("RMobileCall::GetMobileCallInfo returned an error"));
       
   411 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10064 );
       
   412 	ASSERT_TRUE(mobileCallInfo.iValid == 0, _L("RMobileCall::GetMobileCallInfo returned unexpected flags in iValid"));
       
   413 
       
   414 	// Check RMobileCall::GetMobileCallInfo returns valid call name.
       
   415 	ASSERT_TRUE(mobileCallInfo.iCallName.Length() > 0, _L("RMobileCall::GetMobileCallInfo returned an invalid call name"));
       
   416 
       
   417 	// Check RMobileCall::GetMobileCallInfo returns valid line name.
       
   418 	ASSERT_TRUE(mobileCallInfo.iLineName.Length() > 0, _L("RMobileCall::GetMobileCallInfo returned an invalid line name"));
       
   419 
       
   420 	// Check RMobileCall::GetMobileCallInfo returns iDialledParty = 112
       
   421 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10064 );
       
   422 	ASSERT_EQUALS_DES16(mobileCallInfo.iDialledParty.iTelNumber, aNumber, _L("RMobileCall::GetMobileCallInfo returned an invalid number"));
       
   423 
       
   424 	// Check RMobileCall::GetMobileCallInfo returns iEmergency = ETrue
       
   425 	ASSERT_TRUE(mobileCallInfo.iEmergency, _L("RMobileCall::GetMobileCallInfo did not return ETrue for iEmergency"));
       
   426 
       
   427 	// Hang up with RCall::HangUp 
       
   428 	aCall.HangUp(hangUpStatus);
       
   429 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeLong), KErrNone, _L("RCall::HangUp timed-out"));
       
   430 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned an error"));	
       
   431 
       
   432 	// Pop
       
   433     // notifyMobileCallStatusChangeStatus
       
   434     // dialStatus
       
   435     // hangUpStatus
       
   436    CleanupStack::PopAndDestroy(3, &notifyMobileCallStatusChangeStatus);
       
   437     
       
   438 	}
       
   439 
       
   440 
       
   441 TPtrC CCTSYIntegrationTestCallEmergency0001::GetTestStepName()
       
   442 /**
       
   443  * @return The test step name.
       
   444  */
       
   445 	{
       
   446 	return _L("CCTSYIntegrationTestCallEmergency0001");
       
   447 	}
       
   448 
       
   449 
       
   450 
       
   451 CCTSYIntegrationTestCallEmergency0002::CCTSYIntegrationTestCallEmergency0002(CEtelSessionMgr& aEtelSessionMgr)
       
   452 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
   453 /**
       
   454  * Constructor.
       
   455  */
       
   456 	{
       
   457 	SetTestStepName(CCTSYIntegrationTestCallEmergency0002::GetTestStepName());
       
   458 	}
       
   459 
       
   460 CCTSYIntegrationTestCallEmergency0002::~CCTSYIntegrationTestCallEmergency0002()
       
   461 /**
       
   462  * Destructor.
       
   463  */
       
   464 	{
       
   465 	}
       
   466 
       
   467 TVerdict CCTSYIntegrationTestCallEmergency0002::doTestStepL()
       
   468 /**
       
   469  * @SYMTestCaseID BA-CTSY-INT-CEMG-0002
       
   470  * @SYMFssID BA/CTSY/CEMG-0002
       
   471  * @SYMTestCaseDesc Dial an emergency call using SIM/USIM with no emergency numbers stored on it.
       
   472 
       
   473  * @SYMTestPriority High
       
   474  * @SYMTestActions RMobilePhone::VerifySecurityCode, RMobilePhone::NotifySecurityEvent, RMobilePhone::SetFdnSetting, RCall::HangUp, RMobileCall::GetMobileCallStatus, RMobileCall::DialEmergencyCall, RTelServer::SetPriorityClient
       
   475  * @SYMTestExpectedResults Pass - Emergency call can be made to only when FDN is not active and phone is camped on a valid cell. 
       
   476  * @SYMTestType CIT
       
   477  * @SYMTestCaseDependencies simulated/manual
       
   478  *
       
   479  * Reason for test: Verify numbers can be dialled when FDN is inactive but not when active.
       
   480  *
       
   481  * @return - TVerdict code
       
   482  */
       
   483 	{
       
   484 
       
   485 	//
       
   486 	// SET UP
       
   487 	//
       
   488 
       
   489 	
       
   490 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
   491 
       
   492 	// Lock PIN2 with RMobilePhone::SetLockSetting with aLock=ELockPin2, aSetting=ELockSetEnabled 
       
   493 
       
   494 	// Enusre RMobilePhone::GetLockInfo aLock=ELockPin2 returns TMobilePhoneLockInfoV1::iStatus=EStatusLocked and TMobilePhoneLockInfoV1::iSetting = ELockSetEnabled 
       
   495 
       
   496 	// Ensure the FDN is deactivated (RMobilePhone::GetFdnStatus returns EFdnNotActive) 
       
   497 
       
   498 	// Get voice line 1. 
       
   499 
       
   500 	// Get call 1. 
       
   501 
       
   502 
       
   503 	//
       
   504 	// SET UP END
       
   505 	//
       
   506 	
       
   507 	StartTest();
       
   508 	
       
   509 	//
       
   510 	// TEST START
       
   511 	//
       
   512 	
       
   513 	
       
   514 	// Dial RMobileCall::DialEmergencyCall with aNumber=08 
       
   515 
       
   516 	// Simulator should let call ring then answer the call 
       
   517 
       
   518 	// ===  Check mobile call status ===
       
   519 
       
   520 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
   521 
       
   522 	// Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected.
       
   523 
       
   524 	// Hang up with RCall::HangUp 
       
   525 
       
   526 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle
       
   527 
       
   528 	// ===  Activate the FDN ===
       
   529 
       
   530 	// Call RMobilePhone::SetFdnSetting with RMobilePhone::EFdnSetOn 
       
   531 
       
   532 	// Check RMobilePhone::NotifySecurityEvent completes with RMobilePhone::EPin2Required
       
   533 
       
   534 	// Verify PIN2 security code with RMobilePhone::VerifySecurityCode with RMobilePhone::ESecurityCodePin2 
       
   535 
       
   536 	// Check RMobilePhone::NotifySecurityEvent completes with RMobilePhone::EPin2Verified
       
   537 
       
   538 	// Check RMobilePhone::SetFdnSetting completes with KErrNone
       
   539 
       
   540 	// Dial RMobileCall::DialEmergencyCall with aNumber=08 
       
   541 
       
   542 	// Check dialling fails.
       
   543 
       
   544 	// Check RMobileCall::GetMobileCallStatus returns status of EStatusIdle.
       
   545 
       
   546 	// Repeat whole test dialling 000, then 110, then 118, then 119 instead of 08. 
       
   547 
       
   548 	// Repeat whole test with both numbers with simulator simulating phone not camped on suitable cell (forbidden PLMN). 
       
   549 
       
   550 	
       
   551 	//
       
   552 	// TEST END
       
   553 	//
       
   554 
       
   555     StartCleanup();
       
   556 	
       
   557 	// Put any required test clean up here, then remove this comment
       
   558 	
       
   559 	return TestStepResult();
       
   560 	}
       
   561 
       
   562 TPtrC CCTSYIntegrationTestCallEmergency0002::GetTestStepName()
       
   563 /**
       
   564  * @return The test step name.
       
   565  */
       
   566 	{
       
   567 	return _L("CCTSYIntegrationTestCallEmergency0002");
       
   568 	}
       
   569 
       
   570 
       
   571 
       
   572 CCTSYIntegrationTestCallEmergency0003::CCTSYIntegrationTestCallEmergency0003(CEtelSessionMgr& aEtelSessionMgr)
       
   573 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
   574 /**
       
   575  * Constructor.
       
   576  */
       
   577 	{
       
   578 	SetTestStepName(CCTSYIntegrationTestCallEmergency0003::GetTestStepName());
       
   579 	}
       
   580 
       
   581 CCTSYIntegrationTestCallEmergency0003::~CCTSYIntegrationTestCallEmergency0003()
       
   582 /**
       
   583  * Destructor.
       
   584  */
       
   585 	{
       
   586 	}
       
   587 
       
   588 TVerdict CCTSYIntegrationTestCallEmergency0003::doTestStepL()
       
   589 /**
       
   590  * @SYMTestCaseID BA-CTSY-INT-CEMG-0003
       
   591  * @SYMFssID BA/CTSY/CEMG-0003
       
   592  * @SYMTestCaseDesc Dial an emergency call to number not stored in emergency phone book on SIM.
       
   593  * @SYMTestPriority High
       
   594  * @SYMTestActions RMobileCall::NotifyMobileCallStatusChange, RMobileCall::GetMobileCallStatus
       
   595  * @SYMTestExpectedResults Pass - Emergency call to emergency numbers on SIM can be made.
       
   596  * @SYMTestType CIT
       
   597  * @SYMTestCaseDependencies live/automatic
       
   598  *
       
   599  * Reason for test: Verify call can be dialled.
       
   600  *
       
   601  * @return - TVerdict code
       
   602  */
       
   603 	{
       
   604 
       
   605 	//
       
   606 	// SET UP
       
   607 	//
       
   608 
       
   609 	// Check that the phone is registered with the network simulator. 
       
   610     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   611 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   612 	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
   613 	
       
   614 	// Get voice line 1. 
       
   615 	RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
   616 
       
   617 	// Get call 1. 
       
   618 	RMobileCall& voiceCall = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
   619 
       
   620 
       
   621 	//
       
   622 	// SET UP END
       
   623 	//
       
   624 	
       
   625 	StartTest();
       
   626 	
       
   627 	//
       
   628 	// TEST START
       
   629 	//
       
   630 	
       
   631 	// Post notification for the RMobileCall::NotifyMobileCallStatusChange
       
   632 	TExtEtelRequestStatus notifyMobileCallStatusChangeStatus(voiceCall, EMobileCallNotifyMobileCallStatusChange);
       
   633 	CleanupStack::PushL(notifyMobileCallStatusChangeStatus);
       
   634 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
   635 	voiceCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   636 
       
   637 	// Dial a normal number that answers using RMobileCall::DialEmergencyCall 
       
   638     TPtrC number;
       
   639     ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig failed to read KIniVoiceNumberInternational from INI file."));
       
   640     TExtEtelRequestStatus dialStatus(voiceCall, EMobileCallDialEmergencyCall);
       
   641     CleanupStack::PushL(dialStatus);
       
   642     voiceCall.DialEmergencyCall(dialStatus, number);
       
   643 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed-out."));
       
   644 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall returned error."));
       
   645 	
       
   646 	// ===  Check mobile call status ===
       
   647    
       
   648    	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
   649    	RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
   650 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(voiceCall,
       
   651 																		notifyMobileCallStatusChangeStatus,
       
   652 																		mobileCallStatus,
       
   653 																		expectedMobileCallStatus,
       
   654 																		KErrNone);
       
   655 																	
       
   656    	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
   657 	voiceCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);	
       
   658 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(voiceCall,
       
   659 																		notifyMobileCallStatusChangeStatus,
       
   660 																		mobileCallStatus,
       
   661 																		expectedMobileCallStatus,
       
   662 																		KErrNone);
       
   663    	
       
   664    	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
   665 	voiceCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);	
       
   666 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(voiceCall,
       
   667 																		notifyMobileCallStatusChangeStatus,
       
   668 																		mobileCallStatus,
       
   669 																		expectedMobileCallStatus,
       
   670 																		KErrNone);
       
   671 
       
   672 	// Check RMobileCall::GetMobileCallStatus returns status of EStatusConnected.
       
   673     expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
   674 	ASSERT_EQUALS(voiceCall.GetMobileCallStatus(mobileCallStatus), KErrNone, _L("RMobileCall::GetMobileCallStatus returned an Error."));
       
   675 	ASSERT_EQUALS(mobileCallStatus, expectedMobileCallStatus, _L("RMobileCall::GetMobileCallStatus did not set the status to EStatusConnected."));
       
   676 
       
   677 	// Hang up with RCall::HangUp
       
   678 	TCoreEtelRequestStatus<RCall> hangUpStatus (voiceCall, &RCall::HangUpCancel);
       
   679 	CleanupStack::PushL(hangUpStatus);
       
   680 	voiceCall.HangUp(hangUpStatus);
       
   681 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out."));
       
   682 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::CallHangUp returned an error."));
       
   683 
       
   684 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusIdle
       
   685 	expectedMobileCallStatus = RMobileCall::EStatusIdle;
       
   686     voiceCall.NotifyMobileCallStatusChange(notifyMobileCallStatusChangeStatus, mobileCallStatus);
       
   687 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(voiceCall,
       
   688 																		notifyMobileCallStatusChangeStatus,
       
   689 																		mobileCallStatus,
       
   690 																		expectedMobileCallStatus,
       
   691 																		KErrNone);
       
   692 	
       
   693 	//
       
   694 	// TEST END
       
   695 	//
       
   696 
       
   697     StartCleanup();
       
   698 	
       
   699 	// Pop
       
   700 	// notifyMobileCallStatusChangeStatus
       
   701 	// dialStatus
       
   702 	// hangUpStatus
       
   703 	CleanupStack::PopAndDestroy(3, &notifyMobileCallStatusChangeStatus);
       
   704 	
       
   705 	return TestStepResult();
       
   706 	}
       
   707 
       
   708 TPtrC CCTSYIntegrationTestCallEmergency0003::GetTestStepName()
       
   709 /**
       
   710  * @return The test step name.
       
   711  */
       
   712 	{
       
   713 	return _L("CCTSYIntegrationTestCallEmergency0003");
       
   714 	}
       
   715 
       
   716 
       
   717 
       
   718 CCTSYIntegrationTestCallEmergency0004::CCTSYIntegrationTestCallEmergency0004(CEtelSessionMgr& aEtelSessionMgr)
       
   719 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
   720 /**
       
   721  * Constructor.
       
   722  */
       
   723 	{
       
   724 	SetTestStepName(CCTSYIntegrationTestCallEmergency0004::GetTestStepName());
       
   725 	}
       
   726 
       
   727 CCTSYIntegrationTestCallEmergency0004::~CCTSYIntegrationTestCallEmergency0004()
       
   728 /**
       
   729  * Destructor.
       
   730  */
       
   731 	{
       
   732 	}
       
   733 
       
   734 TVerdict CCTSYIntegrationTestCallEmergency0004::doTestStepL()
       
   735 /**
       
   736  * @SYMTestCaseID BA-CTSY-INT-CEMG-0004
       
   737  * @SYMFssID BA/CTSY/CEMG-0004
       
   738  * @SYMTestCaseDesc Dial an emergency call to number not stored in emergency phone book on SIM when FDN active.
       
   739  * @SYMTestPriority High
       
   740  * @SYMTestActions 
       
   741  * @SYMTestExpectedResults Pass - Emergency call cannot be made.
       
   742  * @SYMTestType CIT
       
   743  * @SYMTestCaseDependencies live/automatic
       
   744  *
       
   745  * Reason for test: Verify call cannot be made.
       
   746  *
       
   747  * @return - TVerdict code
       
   748  */
       
   749 	{
       
   750 
       
   751 	//
       
   752 	// SET UP
       
   753 	//
       
   754 	
       
   755 	// Check that the phone is registered with the network simulator. 
       
   756     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   757 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   758 	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
   759 	
       
   760     // Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
   761     TUint32 securityCaps;
       
   762     CHECK_EQUALS_L(phone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
   763     CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps did not return KCapsAccessPin2 bits"));
       
   764 
       
   765    	// Get network operator information
       
   766 	const TDesC* networkSection = NULL;
       
   767 	iNetworkTestHelper.GetNetworkPasswordsSectionL(phone, networkSection);
       
   768 
       
   769 	// Lock PIN2 with RMobilePhone::SetLockSetting with aLock=ELockPin2, aSetting=ELockSetEnabled 
       
   770 	TPtrC pin2; 
       
   771 	CHECK_TRUE_L(GetStringFromConfig(*networkSection, KIniPin2, pin2) != EFalse, _L("GetStringFromConfig failed to read KIniPin2 from INI file"));
       
   772 	RMobilePhone::TMobilePassword pin2Password;
       
   773 	pin2Password.Copy(pin2);
       
   774 	// $CTSYProblem RMobilePhone::SetLockSetting returns KErrNotSupported from LTSY.
       
   775     iPhoneTestHelper.ChangePhoneLockSettingL(phone, RMobilePhone::ELockPin2, RMobilePhone::ELockSetEnabled, pin2, KErrNotSupported);
       
   776 
       
   777 	// Ensure RMobilePhone::GetLockInfo aLock=ELockPin2 returns TMobilePhoneLockInfoV1::iStatus=EStatusLocked and TMobilePhoneLockInfoV1::iSetting = ELockSetEnabled 
       
   778 	RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
       
   779 	RMobilePhone::TMobilePhoneLockInfoV1Pckg infoPckg(lockInfo);
       
   780 	TExtEtelRequestStatus getLockInfoStatus(phone, EMobilePhoneGetLockInfo);
       
   781 	CleanupStack::PushL(getLockInfoStatus);
       
   782 	phone.GetLockInfo(getLockInfoStatus, RMobilePhone::ELockPin2, infoPckg);
       
   783 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getLockInfoStatus, ETimeLong), KErrNone, _L("RMobilePhone::GetLockInfo timed out"));
       
   784 	CHECK_EQUALS_L(getLockInfoStatus.Int(), KErrNone, _L("RMobilePhone::GetLockInfo returned an error"));
       
   785 	CHECK_EQUALS_L(lockInfo.iStatus, RMobilePhone::EStatusLocked, _L("RMobilePhone::GetLockInfo did not returned iStatus = RMobilePhone::EStatusLocked"));
       
   786 	CHECK_EQUALS_L(lockInfo.iSetting, RMobilePhone::ELockSetEnabled, _L("RMobilePhone::GetLockInfo did not returned iSetting = RMobilePhone::ELockSetEnabled"));
       
   787 
       
   788 	// Ensure the FDN is active (RMobilePhone::GetFdnStatus returns EFdnActive)
       
   789     RMobilePhone::TMobilePhoneFdnStatus fdnStatus;
       
   790 	CHECK_EQUALS_L(phone.GetFdnStatus(fdnStatus), KErrNone, _L("RMobilePhone::GetFdnStatus returned an error"));
       
   791 	
       
   792 	if(fdnStatus != RMobilePhone::EFdnActive)
       
   793         {
       
   794         CHECK_EQUALS_L(iPhoneTestHelper.SetPhoneFdnSettingL(phone, pin2Password, RMobilePhone::EFdnSetOn), KErrNone,_L("RMobilePhone::SetFdnSetting failed"));
       
   795         CHECK_EQUALS_L(phone.GetFdnStatus(fdnStatus), KErrNone, _L("RMobilePhone::GetFdnStatus returned an error"));
       
   796         }
       
   797         
       
   798 	CHECK_EQUALS_L(fdnStatus, RMobilePhone::EFdnActive, _L("RMobilePhone::GetFdnStatus did not return RMobilePhone::EFdnActive"));
       
   799 
       
   800 	// Get voice line 1. 
       
   801     RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
   802 
       
   803 	// Get call 1. 
       
   804     RMobileCall& voiceCall = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
   805 
       
   806 
       
   807 	//
       
   808 	// SET UP END
       
   809 	//
       
   810 	
       
   811 	StartTest();
       
   812 	
       
   813 	//
       
   814 	// TEST START
       
   815 	//
       
   816 	
       
   817 	
       
   818     // Dial a normal number that answers using RMobileCall::DialEmergencyCall
       
   819     TPtrC number;
       
   820     ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig failed to read KIniVoiceNumber1 from INI file"));
       
   821     TExtEtelRequestStatus dialStatus(voiceCall, EMobileCallDialEmergencyCall);
       
   822     CleanupStack::PushL(dialStatus);
       
   823     voiceCall.DialEmergencyCall(dialStatus, number);
       
   824     ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed-out"));
       
   825 
       
   826 	// Check no error is returned.
       
   827 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall return error."));
       
   828 	
       
   829 	//
       
   830 	// TEST END
       
   831 	//
       
   832 
       
   833     StartCleanup();
       
   834     
       
   835     voiceCall.HangUp();
       
   836 	
       
   837 	// Pop:
       
   838 	//	dialStatus
       
   839 	//	getLockInfoStatus
       
   840 	CleanupStack::PopAndDestroy(2,&getLockInfoStatus);
       
   841 	
       
   842 	return TestStepResult();
       
   843 	}
       
   844 
       
   845 TPtrC CCTSYIntegrationTestCallEmergency0004::GetTestStepName()
       
   846 /**
       
   847  * @return The test step name.
       
   848  */
       
   849 	{
       
   850 	return _L("CCTSYIntegrationTestCallEmergency0004");
       
   851 	}
       
   852 
       
   853 
       
   854 
       
   855 CCTSYIntegrationTestCallEmergency0005::CCTSYIntegrationTestCallEmergency0005(CEtelSessionMgr& aEtelSessionMgr)
       
   856 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
   857 /**
       
   858  * Constructor.
       
   859  */
       
   860 	{
       
   861 	SetTestStepName(CCTSYIntegrationTestCallEmergency0005::GetTestStepName());
       
   862 	}
       
   863 
       
   864 CCTSYIntegrationTestCallEmergency0005::~CCTSYIntegrationTestCallEmergency0005()
       
   865 /**
       
   866  * Destructor.
       
   867  */
       
   868 	{
       
   869 	}
       
   870 
       
   871 TVerdict CCTSYIntegrationTestCallEmergency0005::doTestStepL()
       
   872 /**
       
   873  * @SYMTestCaseID BA-CTSY-INT-CEMG-0005
       
   874  * @SYMFssID BA/CTSY/CEMG-0005
       
   875  * @SYMTestCaseDesc Dial an emergency call to number not stored in emergency phone book on SIM when phone not IMSI attached.
       
   876  * @SYMTestPriority High
       
   877  * @SYMTestActions RMobilePhone::GetNetworkRegistrationStatus
       
   878  * @SYMTestExpectedResults Pass - Emergency call cannot be made.
       
   879  * @SYMTestType CIT
       
   880  * @SYMTestCaseDependencies simulated/manual
       
   881  *
       
   882  * Reason for test: Verify call cannot be made.
       
   883  *
       
   884  * @return - TVerdict code
       
   885  */
       
   886 	{
       
   887 
       
   888 	//
       
   889 	// SET UP
       
   890 	//
       
   891 
       
   892     // Check that the phone is registered with the network simulator. 
       
   893 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   894 	
       
   895 	// Get voice line 1. 
       
   896 	RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
   897 	
       
   898 	// Get call 1. 
       
   899 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
   900 	
       
   901 	//
       
   902 	// SET UP END
       
   903 	//
       
   904 	
       
   905 	StartTest();
       
   906 	
       
   907 	//
       
   908 	// TEST START
       
   909 	//
       
   910 	
       
   911 	// Simulate no signal.
       
   912 	DisplayUserInteractionPromptL(_L("Simulate no signal"), ETimeMedium);
       
   913  
       
   914 	// RMobilePhone::GetNetworkRegistrationStatus returns ENotRegisteredNoService
       
   915 	RMobilePhone::TMobilePhoneRegistrationStatus registrationStatus;
       
   916 	TExtEtelRequestStatus getNWRegistrationStatusStatus(phone,EMobilePhoneGetNetworkRegistrationStatus);
       
   917 	CleanupStack::PushL(getNWRegistrationStatusStatus);
       
   918 	phone.GetNetworkRegistrationStatus(getNWRegistrationStatusStatus,registrationStatus);
       
   919 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getNWRegistrationStatusStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetNetworkRegistrationStatus timed out"));	
       
   920 	ASSERT_EQUALS(getNWRegistrationStatusStatus.Int(), KErrNone,  _L("RMobilePhone::GetNetworkRegistrationStatus returned an error"));
       
   921 	TExtEtelRequestStatus reqStatus(phone, EMobilePhoneNotifyNetworkRegistrationStatusChange );
       
   922 	CleanupStack::PushL(reqStatus);
       
   923 	if(registrationStatus!= RMobilePhone::ENotRegisteredNoService)
       
   924 		{
       
   925 		phone.NotifyNetworkRegistrationStatusChange(reqStatus, registrationStatus);
       
   926 		iNetworkTestHelper.WaitForMobilePhoneNotifyNetworkRegistrationStatusChange( phone, 
       
   927 										reqStatus, registrationStatus,
       
   928 										RMobilePhone::ENotRegisteredNoService, KErrNone );
       
   929 		
       
   930 		}
       
   931 	ASSERT_EQUALS(registrationStatus, RMobilePhone::ENotRegisteredNoService, _L("RMobilePhone::GetNetworkRegistrationStatus did not return ENotRegisteredNoService"));
       
   932 	TEST_CHECK_POINT_L(_L("We might have a signal, could not make an emergency call"));
       
   933  
       
   934 	// Dial RMobileCall::DialEmergencyCall with aNumber=999 
       
   935     TExtEtelRequestStatus dialStatus(call1, EMobileCallDialEmergencyCall);
       
   936     CleanupStack::PushL(dialStatus);
       
   937     call1.DialEmergencyCall(dialStatus, KEmergencyNumber999);
       
   938     ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeVeryLong), KErrNone,  _L("RMobileCall::DialEmergencyCall timed-out"));
       
   939 
       
   940 	// Verify emergency call cannot be made. 
       
   941 	ASSERT_TRUE(dialStatus.Int() != KErrNone, _L("RMobileCall::DialEmergencyCall did not return an error as expected."));
       
   942 	
       
   943 	//
       
   944 	// TEST END
       
   945 	//
       
   946 
       
   947     StartCleanup();
       
   948     
       
   949     // Pop
       
   950     // getNWRegistrationStatusStatus
       
   951     // reqStatus
       
   952     // dialStatus 	
       
   953 	CleanupStack::PopAndDestroy(3, &getNWRegistrationStatusStatus);
       
   954 	
       
   955 	return TestStepResult();
       
   956 	}
       
   957 
       
   958 TPtrC CCTSYIntegrationTestCallEmergency0005::GetTestStepName()
       
   959 /**
       
   960  * @return The test step name.
       
   961  */
       
   962 	{
       
   963 	return _L("CCTSYIntegrationTestCallEmergency0005");
       
   964 	}
       
   965 
       
   966 
       
   967 
       
   968 CCTSYIntegrationTestCallEmergency0006::CCTSYIntegrationTestCallEmergency0006(CEtelSessionMgr& aEtelSessionMgr)
       
   969 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
   970 /**
       
   971  * Constructor.
       
   972  */
       
   973 	{
       
   974 	SetTestStepName(CCTSYIntegrationTestCallEmergency0006::GetTestStepName());
       
   975 	}
       
   976 
       
   977 CCTSYIntegrationTestCallEmergency0006::~CCTSYIntegrationTestCallEmergency0006()
       
   978 /**
       
   979  * Destructor.
       
   980  */
       
   981 	{
       
   982 	}
       
   983 
       
   984 TVerdict CCTSYIntegrationTestCallEmergency0006::doTestStepL()
       
   985 /**
       
   986  * @SYMTestCaseID BA-CTSY-INT-CEMG-0006
       
   987  * @SYMFssID BA/CTSY/CEMG-0006
       
   988  * @SYMTestCaseDesc Dialling emergency calls with no SIM.
       
   989  * @SYMTestPriority High
       
   990  * @SYMTestActions RMobileCall::NotifyMobileCallStatusChange, RMobileCall::GetMobileCallStatus, RCall::HangUp
       
   991  * @SYMTestExpectedResults Pass - Emergency call can be made.
       
   992  * @SYMTestType CIT
       
   993  * @SYMTestCaseDependencies simulated/manual
       
   994  *
       
   995  * Reason for test: Verify emergency call can be made.
       
   996  *
       
   997  * @return - TVerdict code
       
   998  */
       
   999 	{
       
  1000 
       
  1001 	//
       
  1002 	// SET UP
       
  1003 	//
       
  1004 	
       
  1005 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1006     
       
  1007 	// Get voice line 1. 
       
  1008 	RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1009 	
       
  1010 	// Get call 1. 
       
  1011 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
  1012 
       
  1013 	//
       
  1014 	// SET UP END
       
  1015 	//
       
  1016 	
       
  1017 	StartTest();
       
  1018 	
       
  1019 	//
       
  1020 	// TEST START
       
  1021 	//
       
  1022 	
       
  1023 	// Dial RMobileCall::DialEmergencyCall with aNumber=112
       
  1024 	MakeEmergencyCallL(call1, KEmergencyNumber112);
       
  1025 
       
  1026 	// Repeat test with aNumber = 08, 000, 110, 118, 119, 999.
       
  1027 	MakeEmergencyCallL(call1, KEmergencyNumber08);
       
  1028 	MakeEmergencyCallL(call1, KEmergencyNumber000);
       
  1029 	MakeEmergencyCallL(call1, KEmergencyNumber110);
       
  1030 	MakeEmergencyCallL(call1, KEmergencyNumber118);
       
  1031 	MakeEmergencyCallL(call1, KEmergencyNumber119);
       
  1032 	MakeEmergencyCallL(call1, KEmergencyNumber999);
       
  1033 
       
  1034 	//
       
  1035 	// TEST END
       
  1036 	//
       
  1037 
       
  1038     StartCleanup();
       
  1039 		
       
  1040 	return TestStepResult();
       
  1041 	}
       
  1042 
       
  1043 TPtrC CCTSYIntegrationTestCallEmergency0006::GetTestStepName()
       
  1044 /**
       
  1045  * @return The test step name.
       
  1046  */
       
  1047 	{
       
  1048 	return _L("CCTSYIntegrationTestCallEmergency0006");
       
  1049 	}
       
  1050 
       
  1051 
       
  1052 
       
  1053 CCTSYIntegrationTestCallEmergency0007::CCTSYIntegrationTestCallEmergency0007(CEtelSessionMgr& aEtelSessionMgr)
       
  1054 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
  1055 /**
       
  1056  * Constructor.
       
  1057  */
       
  1058 	{
       
  1059 	SetTestStepName(CCTSYIntegrationTestCallEmergency0007::GetTestStepName());
       
  1060 	}
       
  1061 
       
  1062 CCTSYIntegrationTestCallEmergency0007::~CCTSYIntegrationTestCallEmergency0007()
       
  1063 /**
       
  1064  * Destructor.
       
  1065  */
       
  1066 	{
       
  1067 	}
       
  1068 
       
  1069 TVerdict CCTSYIntegrationTestCallEmergency0007::doTestStepL()
       
  1070 /**
       
  1071  * @SYMTestCaseID BA-CTSY-INT-CEMG-0007
       
  1072  * @SYMFssID BA/CTSY/CEMG-0007
       
  1073  * @SYMTestCaseDesc Dial emergency call can be made when PIN1 blocked
       
  1074  * @SYMTestPriority High
       
  1075  * @SYMTestActions RMobileCall::NotifyMobileCallStatusChange, RMobileCall::GetMobileCallStatus, RCall::HangUp
       
  1076  * @SYMTestExpectedResults Pass - Emergency call can be made.
       
  1077  * @SYMTestType CIT
       
  1078  * @SYMTestCaseDependencies simulated/manual
       
  1079  *
       
  1080  * Reason for test: Verify emergency call can be made.
       
  1081  *
       
  1082  * @return - TVerdict code
       
  1083  */
       
  1084 	{
       
  1085 
       
  1086 	//
       
  1087 	// SET UP
       
  1088 	//
       
  1089 	
       
  1090 	// Check that the phone is registered with the network simulator. 
       
  1091     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1092 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1093 	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
  1094 	
       
  1095 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin1 | KCapsLockICC
       
  1096 	TUint32 securityCaps;
       
  1097 	TUint32 wantedSecurityCaps = RMobilePhone::KCapsAccessPin1 | RMobilePhone::KCapsLockICC;
       
  1098     CHECK_EQUALS_L(phone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
  1099     CHECK_BITS_SET_L(securityCaps, wantedSecurityCaps, KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps did not return caps in set of KCapsAccessPin1 | KCapsLockICC"));
       
  1100 
       
  1101 	// get network operator information
       
  1102 	const TDesC* networkSection = NULL;
       
  1103 	iNetworkTestHelper.GetNetworkPasswordsSectionL(phone, networkSection);
       
  1104 
       
  1105 	// Get the password from the ini file
       
  1106 	TPtrC pin1; 
       
  1107 	CHECK_TRUE_L(GetStringFromConfig(*networkSection, KIniPin1, pin1) != EFalse, 
       
  1108 			_L("GetStringFromConfig returned with an error"));
       
  1109 
       
  1110 	// Enable PIN1 with RMobilePhone::SetLockSetting with aLock=ELockICC, aSetting=ELockSetEnabled
       
  1111     iPhoneTestHelper.ChangePhoneLockSettingL(phone, RMobilePhone::ELockICC,RMobilePhone::ELockSetEnabled, pin1);
       
  1112 
       
  1113 	// Block PIN1 by calling RMobilePhone::VerifySecurityCode with aType=ESecurityCodePin1, aCode = wrong PIN1 until RMobilePhone::GetLockInfo with aLock=ELockICC returns TMobilePhoneSecurityCodeInfoV5::iRemainingEntryAttempts=0 then calling RMobilePhone::VerifySecurityCode one more time with aCode=wrong PIN1.
       
  1114     iPhoneTestHelper.BlockPinL(phone, RMobilePhone::ESecurityCodePin1);
       
  1115 
       
  1116 	// Check RMobilePhone::GetLockInfo returns error
       
  1117 	RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
       
  1118 	RMobilePhone::TMobilePhoneLockInfoV1Pckg infoPckg(lockInfo);
       
  1119 	TExtEtelRequestStatus getLockInfoStatus(phone, EMobilePhoneGetLockInfo);
       
  1120 	CleanupStack::PushL(getLockInfoStatus);
       
  1121 	phone.GetLockInfo(getLockInfoStatus, RMobilePhone::ELockICC, infoPckg);
       
  1122 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getLockInfoStatus, ETimeLong), KErrNone, _L("RMobilePhone::GetLockInfo timed out"));
       
  1123 	CHECK_TRUE_L(getLockInfoStatus.Int() != KErrNone, _L("RMobilePhone::GetLockInfo did not returned with an error"));
       
  1124 
       
  1125 	// Get voice line 1. 
       
  1126     RMobileLine& voiceLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1127 
       
  1128 	// Get call 1. 
       
  1129     RMobileCall& voiceCall = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
  1130 	
       
  1131 
       
  1132 	//
       
  1133 	// SET UP END
       
  1134 	//
       
  1135 	
       
  1136 	StartTest();
       
  1137 	
       
  1138 	//
       
  1139 	// TEST START
       
  1140 	//
       
  1141 	
       
  1142 	
       
  1143 	// Dial RMobileCall::DialEmergencyCall with aNumber=112
       
  1144 	// $CTSYProblem Can't make ergency call when phone is PIN1 blocked, LTSY returns an error 
       
  1145     CHECK_TRUE_L(EFalse,_L("$CTSYProblem Can't make ergency call when phone is PIN1 blocked, LTSY returns an error"));
       
  1146 	MakeEmergencyCallL(voiceCall, KEmergencyNumber112);
       
  1147 
       
  1148 	// Repeat test with aNumber = 08, 000, 110, 118, 119, 999. 
       
  1149 	MakeEmergencyCallL(voiceCall, KEmergencyNumber08);
       
  1150 	MakeEmergencyCallL(voiceCall, KEmergencyNumber000);
       
  1151 	MakeEmergencyCallL(voiceCall, KEmergencyNumber110);
       
  1152 	MakeEmergencyCallL(voiceCall, KEmergencyNumber118);
       
  1153 	MakeEmergencyCallL(voiceCall, KEmergencyNumber119);
       
  1154 	MakeEmergencyCallL(voiceCall, KEmergencyNumber999);
       
  1155 
       
  1156 	//
       
  1157 	// TEST END
       
  1158 	//
       
  1159 
       
  1160     StartCleanup();
       
  1161     
       
  1162     iPhoneTestHelper.ChangePhoneLockSettingL(phone, RMobilePhone::ELockICC, RMobilePhone::ELockSetDisabled, pin1);
       
  1163 	
       
  1164 	// Pop
       
  1165 	// getLockInfoStatus
       
  1166 	CleanupStack::PopAndDestroy(1, &getLockInfoStatus);
       
  1167 	
       
  1168 	return TestStepResult();
       
  1169 	}
       
  1170 
       
  1171 TPtrC CCTSYIntegrationTestCallEmergency0007::GetTestStepName()
       
  1172 /**
       
  1173  * @return The test step name.
       
  1174  */
       
  1175 	{
       
  1176 	return _L("CCTSYIntegrationTestCallEmergency0007");
       
  1177 	}
       
  1178 
       
  1179 
       
  1180 
       
  1181 CCTSYIntegrationTestCallEmergency0008::CCTSYIntegrationTestCallEmergency0008(CEtelSessionMgr& aEtelSessionMgr)
       
  1182 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
  1183 /**
       
  1184  * Constructor.
       
  1185  */
       
  1186 	{
       
  1187 	SetTestStepName(CCTSYIntegrationTestCallEmergency0008::GetTestStepName());
       
  1188 	}
       
  1189 
       
  1190 CCTSYIntegrationTestCallEmergency0008::~CCTSYIntegrationTestCallEmergency0008()
       
  1191 /**
       
  1192  * Destructor.
       
  1193  */
       
  1194 	{
       
  1195 	}
       
  1196 
       
  1197 TVerdict CCTSYIntegrationTestCallEmergency0008::doTestStepL()
       
  1198 /**
       
  1199  * @SYMTestCaseID BA-CTSY-INT-CEMG-0008
       
  1200  * @SYMFssID BA/CTSY/CEMG-0008
       
  1201  * @SYMTestCaseDesc Dial emergency call can be made (when PIN2 blocked).
       
  1202 
       
  1203  * @SYMTestPriority High
       
  1204  * @SYMTestActions RMobileCall::NotifyMobileCallStatusChange, RMobileCall::GetMobileCallStatus, RCall::HangUp
       
  1205  * @SYMTestExpectedResults Pass - Emergency call can be made.
       
  1206  * @SYMTestType CIT
       
  1207  * @SYMTestCaseDependencies simulated/manual
       
  1208  *
       
  1209  * Reason for test: Verify emergency call can be made.
       
  1210  *
       
  1211  * @return - TVerdict code
       
  1212  */
       
  1213 	{
       
  1214 
       
  1215 	//
       
  1216 	// SET UP
       
  1217 	//
       
  1218 
       
  1219 	
       
  1220     // Check that the phone is registered with the network simulator. 
       
  1221     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1222 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1223 	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
  1224 
       
  1225 	// ===  Block PIN2 ===
       
  1226 
       
  1227 	// Ensure RMobilePhone::GetSecurityCaps returns caps in set of KCapsAccessPin2 
       
  1228 	TUint32 securityCaps;
       
  1229 	CHECK_EQUALS_L(phone.GetSecurityCaps(securityCaps), KErrNone,_L("RMobilePhone::GetSecurityCaps returned with an error"));
       
  1230 	CHECK_BITS_SET_L(securityCaps,RMobilePhone::KCapsAccessPin2 ,KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps returned did not return KCapsAccessPin2 bits"));
       
  1231 
       
  1232 	// Get network operator information
       
  1233 	const TDesC* networkSection = NULL;
       
  1234 	iNetworkTestHelper.GetNetworkPasswordsSectionL(phone, networkSection);
       
  1235 
       
  1236 	// Get the password from the ini file
       
  1237 	TPtrC pin2; 
       
  1238 	CHECK_TRUE_L(GetStringFromConfig(*networkSection, KIniPin2, pin2) != EFalse, _L("GetStringFromConfig returned with an error"));
       
  1239 
       
  1240 	// Enable PIN2 with RMobilePhone::SetLockSetting with aLock=ELockPin2, aSetting=ELockSetEnabled 
       
  1241 	// $CTSYProblem RMobilePhone::SetLockSetting returns KErrNotSupported from LTSY.
       
  1242 	iPhoneTestHelper.ChangePhoneLockSettingL(phone, RMobilePhone::ELockPin2, RMobilePhone::ELockSetEnabled, pin2, KErrNotSupported);
       
  1243 
       
  1244 	// Block PIN2 by calling RMobilePhone::VerifySecurityCode with aType=ESecurityCodePin2, aCode = wrong PIN2 
       
  1245 	// until RMobilePhone::GetLockInfo with aLock=ELockPin2 returns TMobilePhoneSecurityCodeInfoV5::iRemainingEntryAttempts=0 
       
  1246 	// then calling RMobilePhone::VerifySecurityCode one more time with aCode=wrong PIN2. 
       
  1247 	iPhoneTestHelper.BlockPinL(phone, RMobilePhone::ESecurityCodePin2);
       
  1248 
       
  1249 	// Check RMobilePhone::GetLockInfo with aLock=ELockPin2 returns iSetting=ELockSetEnabled and iStatus=EStatusBlocked
       
  1250 	// $CTSYProblem RMobilePhone::GetLockInfo returns KErrGsm0707SIMPuk2Required from LTSY when the phone is locked.
       
  1251 	RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
       
  1252 	RMobilePhone::TMobilePhoneLockInfoV1Pckg infoPckg(lockInfo);
       
  1253 	TExtEtelRequestStatus getLockInfoStatus(phone, EMobilePhoneGetLockInfo);
       
  1254 	CleanupStack::PushL(getLockInfoStatus);
       
  1255 	phone.GetLockInfo(getLockInfoStatus, RMobilePhone::ELockPin2, infoPckg);
       
  1256 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getLockInfoStatus, ETimeLong), KErrNone, _L("RMobilePhone::GetLockInfo timed out"));
       
  1257 	CHECK_EQUALS_L(getLockInfoStatus.Int(), KErrGsm0707SIMPuk2Required, _L("RMobilePhone::GetLockInfo returned an error"));
       
  1258 
       
  1259 	// Get voice line 1. 
       
  1260 	RMobileLine& line1 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1261 
       
  1262 	// Get call 1. 
       
  1263 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine, KCall1);
       
  1264 
       
  1265 
       
  1266 	//
       
  1267 	// SET UP END
       
  1268 	//
       
  1269 	
       
  1270 	StartTest();
       
  1271 	
       
  1272 	//
       
  1273 	// TEST START
       
  1274 	//
       
  1275 
       
  1276 
       
  1277     // Dian emergency call with aNumber = 112
       
  1278     MakeEmergencyCallL(call1, KEmergencyNumber112);
       
  1279     
       
  1280 	// Repeat test with aNumber = 08, 000, 110, 118, 119, 999. 
       
  1281     MakeEmergencyCallL(call1, KEmergencyNumber08);
       
  1282     MakeEmergencyCallL(call1, KEmergencyNumber000);
       
  1283     MakeEmergencyCallL(call1, KEmergencyNumber110);
       
  1284     MakeEmergencyCallL(call1, KEmergencyNumber118);
       
  1285     MakeEmergencyCallL(call1, KEmergencyNumber119);
       
  1286     MakeEmergencyCallL(call1, KEmergencyNumber999);
       
  1287 
       
  1288 	//
       
  1289 	// TEST END
       
  1290 	//
       
  1291 
       
  1292     StartCleanup();
       
  1293 	
       
  1294 	// Pop:
       
  1295 	//	getLockInfoStatus
       
  1296 	CleanupStack::PopAndDestroy(1,&getLockInfoStatus);
       
  1297 	
       
  1298 	return TestStepResult();
       
  1299 	}
       
  1300 
       
  1301 TPtrC CCTSYIntegrationTestCallEmergency0008::GetTestStepName()
       
  1302 /**
       
  1303  * @return The test step name.
       
  1304  */
       
  1305 	{
       
  1306 	return _L("CCTSYIntegrationTestCallEmergency0008");
       
  1307 	}
       
  1308 
       
  1309 
       
  1310 
       
  1311 CCTSYIntegrationTestCallEmergency0009::CCTSYIntegrationTestCallEmergency0009(CEtelSessionMgr& aEtelSessionMgr)
       
  1312 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
  1313 /**
       
  1314  * Constructor.
       
  1315  */
       
  1316 	{
       
  1317 	SetTestStepName(CCTSYIntegrationTestCallEmergency0009::GetTestStepName());
       
  1318 	}
       
  1319 
       
  1320 CCTSYIntegrationTestCallEmergency0009::~CCTSYIntegrationTestCallEmergency0009()
       
  1321 /**
       
  1322  * Destructor.
       
  1323  */
       
  1324 	{
       
  1325 	}
       
  1326 
       
  1327 TVerdict CCTSYIntegrationTestCallEmergency0009::doTestStepL()
       
  1328 /**
       
  1329  * @SYMTestCaseID BA-CTSY-INT-CEMG-0009
       
  1330  * @SYMFssID BA/CTSY/CEMG-0009
       
  1331  * @SYMTestCaseDesc Dial emergency call can be made when defective SIM is used.
       
  1332  * @SYMTestPriority High
       
  1333  * @SYMTestActions RMobileCall::NotifyMobileCallStatusChange, RMobileCall::GetMobileCallStatus, RCall::HangUp
       
  1334  * @SYMTestExpectedResults Pass - Emergency call can be made.
       
  1335  * @SYMTestType CIT
       
  1336  * @SYMTestCaseDependencies simulated/manual
       
  1337  *
       
  1338  * Reason for test: Verify emergency call can be made.
       
  1339  *
       
  1340  * @return - TVerdict code
       
  1341  */
       
  1342 	{
       
  1343 
       
  1344 	//
       
  1345 	// SET UP
       
  1346 	//
       
  1347 
       
  1348 
       
  1349     // Check that the phone is registered with the network simulator. 
       
  1350     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1351 
       
  1352 	// Get voice line 1. 
       
  1353 	RMobileLine& line1 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1354 
       
  1355 	// Get call 1. 
       
  1356 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine, KCall1);
       
  1357 
       
  1358 
       
  1359 	//
       
  1360 	// SET UP END
       
  1361 	//
       
  1362 	
       
  1363 	StartTest();
       
  1364 	
       
  1365 	//
       
  1366 	// TEST START
       
  1367 	//
       
  1368 	
       
  1369 	
       
  1370 	// Insert defective SIM. 
       
  1371 
       
  1372     // Dian emergency call with aNumber = 112
       
  1373     MakeEmergencyCallL(call1, KEmergencyNumber112);
       
  1374 
       
  1375 	// Repeat test with aNumber = 08, 000, 110, 118, 119, 999. 
       
  1376     MakeEmergencyCallL(call1, KEmergencyNumber08);
       
  1377     MakeEmergencyCallL(call1, KEmergencyNumber000);
       
  1378     MakeEmergencyCallL(call1, KEmergencyNumber110);
       
  1379     MakeEmergencyCallL(call1, KEmergencyNumber118);
       
  1380     MakeEmergencyCallL(call1, KEmergencyNumber119);
       
  1381 	MakeEmergencyCallL(call1, KEmergencyNumber999);
       
  1382 
       
  1383 	//
       
  1384 	// TEST END
       
  1385 	//
       
  1386 
       
  1387     StartCleanup();
       
  1388 	
       
  1389 	return TestStepResult();
       
  1390 	}
       
  1391 
       
  1392 
       
  1393 TPtrC CCTSYIntegrationTestCallEmergency0009::GetTestStepName()
       
  1394 /**
       
  1395  * @return The test step name.
       
  1396  */
       
  1397 	{
       
  1398 	return _L("CCTSYIntegrationTestCallEmergency0009");
       
  1399 	}
       
  1400 
       
  1401 
       
  1402 
       
  1403 CCTSYIntegrationTestCallEmergency0010::CCTSYIntegrationTestCallEmergency0010(CEtelSessionMgr& aEtelSessionMgr)
       
  1404 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
  1405 /**
       
  1406  * Constructor.
       
  1407  */
       
  1408 	{
       
  1409 	SetTestStepName(CCTSYIntegrationTestCallEmergency0010::GetTestStepName());
       
  1410 	}
       
  1411 
       
  1412 CCTSYIntegrationTestCallEmergency0010::~CCTSYIntegrationTestCallEmergency0010()
       
  1413 /**
       
  1414  * Destructor.
       
  1415  */
       
  1416 	{
       
  1417 	}
       
  1418 
       
  1419 TVerdict CCTSYIntegrationTestCallEmergency0010::doTestStepL()
       
  1420 /**
       
  1421  * @SYMTestCaseID BA-CTSY-INT-CEMG-0010
       
  1422  * @SYMFssID BA/CTSY/CEMG-0010
       
  1423  * @SYMTestCaseDesc Request emergency call when other call active
       
  1424  * @SYMTestPriority High
       
  1425  * @SYMTestActions RCall::HangUp, RMobileCall::DialEmergencyCall, RCall::Dial
       
  1426  * @SYMTestExpectedResults Pass - Emergency call made and other active call goes idle.
       
  1427  * @SYMTestType CIT
       
  1428  * @SYMTestCaseDependencies simulated/manual
       
  1429  *
       
  1430  * Reason for test: Verify emergency call can be made.
       
  1431  *
       
  1432  * @return - TVerdict code
       
  1433  */
       
  1434 	{
       
  1435 
       
  1436 	//
       
  1437 	// SET UP
       
  1438 	//
       
  1439 
       
  1440 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1441 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1442     
       
  1443     // Check if we are on a simulated network to run emergency call tests; Leave if not
       
  1444  	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
  1445 
       
  1446 	// Get voice line 1. 
       
  1447 	RMobileLine& line1 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1448 	
       
  1449 	// Get call 1. 
       
  1450 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
  1451 	
       
  1452 	// Get voice line 2. 
       
  1453 	RMobileLine& line2 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1454 
       
  1455 	// Get call 2. 
       
  1456 	RMobileCall& call2 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall2);
       
  1457 
       
  1458 	// Get data line 1. 
       
  1459 	RMobileLine& dataLine = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KDataLine);
       
  1460 	
       
  1461 	// Get call 3.
       
  1462 	RMobileCall& call3 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KDataLine, KCall3);
       
  1463 
       
  1464 
       
  1465 	//
       
  1466 	// SET UP END
       
  1467 	//
       
  1468 	
       
  1469 	StartTest();
       
  1470 	
       
  1471 	//
       
  1472 	// TEST START
       
  1473 	//
       
  1474 	
       
  1475 	
       
  1476 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange for call1
       
  1477 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
  1478 	TExtEtelRequestStatus notifyCallStChange(call1, EMobileCallNotifyMobileCallStatusChange);
       
  1479 	CleanupStack::PushL(notifyCallStChange);
       
  1480 	call1.NotifyMobileCallStatusChange(notifyCallStChange, mobileCallStatus);
       
  1481 	
       
  1482 	// ===  Dial a number on call 1 ===
       
  1483 
       
  1484 	// Dial a number that answers on call 1 with RCall::Dial. 
       
  1485 	TPtrC number;
       
  1486 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1487 	TCoreEtelRequestStatus<RMobileCall> dialStatus(call1, &RMobileCall::DialCancel);
       
  1488 	CleanupStack::PushL(dialStatus);
       
  1489 	call1.Dial(dialStatus, number);	
       
  1490     ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  1491 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial returned error."));
       
  1492 	
       
  1493 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1494 	RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
  1495 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1496 																		notifyCallStChange,
       
  1497 																		mobileCallStatus,
       
  1498 																		expectedMobileCallStatus,
       
  1499 																		KErrNone);
       
  1500 	// Repost notifier
       
  1501 	call1.NotifyMobileCallStatusChange(notifyCallStChange, mobileCallStatus);
       
  1502 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
  1503 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1504 																		notifyCallStChange,
       
  1505 																		mobileCallStatus,
       
  1506 																		expectedMobileCallStatus,
       
  1507 																		KErrNone);
       
  1508 	// Repost notifier
       
  1509 	call1.NotifyMobileCallStatusChange(notifyCallStChange, mobileCallStatus);
       
  1510 	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
  1511 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1512 																		notifyCallStChange,
       
  1513 																		mobileCallStatus,
       
  1514 																		expectedMobileCallStatus,
       
  1515 																		KErrNone);																	
       
  1516 																	
       
  1517 	// Repost notifier for call1
       
  1518 	call1.NotifyMobileCallStatusChange(notifyCallStChange, mobileCallStatus);
       
  1519 
       
  1520 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange for call2
       
  1521 	RMobileCall::TMobileCallStatus mobileCall2Status;
       
  1522 	TExtEtelRequestStatus notifyCall2StChange(call2, EMobileCallNotifyMobileCallStatusChange);
       
  1523 	CleanupStack::PushL(notifyCall2StChange);
       
  1524 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1525 	
       
  1526 	// ===  Dial an emergency call and check that it gets connected and call 1 is disconnected ===
       
  1527 	// Dial an emergency call on call 2 with RMobileCall::DialEmergencyCall 
       
  1528 	TExtEtelRequestStatus dialStatusCall2(call2, EMobileCallDialEmergencyCall);
       
  1529 	CleanupStack::PushL(dialStatusCall2);
       
  1530 	call2.DialEmergencyCall(dialStatusCall2, KEmergencyNumber112);
       
  1531 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10063 );
       
  1532 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall2, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed out"));
       
  1533 	ASSERT_EQUALS(dialStatusCall2.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall returned with error"));
       
  1534 
       
  1535 	// Check RMobileCall::NotifyMobileCallStatusChange on call 2 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1536 	RMobileCall::TMobileCallStatus expectedMobileCall2Status = RMobileCall::EStatusDialling;
       
  1537 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1538 																		notifyCall2StChange,
       
  1539 																		mobileCall2Status,
       
  1540 																		expectedMobileCall2Status,
       
  1541 																		KErrNone);
       
  1542 	// Repost notifier
       
  1543 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1544 	expectedMobileCall2Status = RMobileCall::EStatusConnecting;
       
  1545 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1546 																		notifyCall2StChange,
       
  1547 																		mobileCall2Status,
       
  1548 																		expectedMobileCall2Status,
       
  1549 																		KErrNone);
       
  1550 	// Repost notifier
       
  1551 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1552 	expectedMobileCall2Status = RMobileCall::EStatusConnected;
       
  1553 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1554 																		notifyCall2StChange,
       
  1555 																		mobileCall2Status,
       
  1556 																		expectedMobileCall2Status,
       
  1557 																		KErrNone);	
       
  1558 	
       
  1559 	
       
  1560 	// Check RMobileCall::NotifyMobileCallStatusChange on call 1 completes with EStatusIdle
       
  1561 	expectedMobileCallStatus = RMobileCall::EStatusIdle;
       
  1562 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1563 																		notifyCallStChange,
       
  1564 																		mobileCallStatus,
       
  1565 																		expectedMobileCallStatus,
       
  1566 																		KErrNone);
       
  1567 																		
       
  1568 	// Repost notifier
       
  1569 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1570 																		
       
  1571 	// Hang up call 2 with RCall::HangUp 
       
  1572 	TCoreEtelRequestStatus<RMobileCall> hangUpStatus (call2, &RCall::HangUpCancel);	
       
  1573 	CleanupStack::PushL(hangUpStatus);
       
  1574 	call2.HangUp(hangUpStatus);
       
  1575 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeLong), KErrNone, _L("RCall::HangUp timed-out"));
       
  1576 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned an error"));	
       
  1577 	
       
  1578 	// Check RMobileCall::NotifyMobileCallStatusChange on call 2 completes with EStatusIdle
       
  1579 	expectedMobileCall2Status = RMobileCall::EStatusIdle;
       
  1580 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1581 																		notifyCall2StChange,
       
  1582 																		mobileCall2Status,
       
  1583 																		expectedMobileCall2Status,
       
  1584 																		KErrNone);
       
  1585 	// ===  Dial a number on call 3 ===
       
  1586 	
       
  1587 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange for call3
       
  1588 	RMobileCall::TMobileCallStatus mobileCallStatusDataCall;
       
  1589 	TExtEtelRequestStatus notifyDataCallStChange(call3, EMobileCallNotifyMobileCallStatusChange);
       
  1590 	CleanupStack::PushL(notifyDataCallStChange);
       
  1591 	call3.NotifyMobileCallStatusChange(notifyDataCallStChange, mobileCallStatusDataCall);
       
  1592 	
       
  1593 	// Dial a data call to a number that answers. 
       
  1594 	// $CTSYProblem Can't make datacall with LTSY and the Anite SIM 
       
  1595     CHECK_TRUE_L(EFalse,_L("$CTSYProblem Can't make datacall with LTSY and the Anite SIM"));
       
  1596 	TPtrC dataNumber;
       
  1597 	ASSERT_TRUE(GetStringFromConfig(KIniDataNumSection, KIniDataNumber1, dataNumber) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1598 	TCoreEtelRequestStatus<RCall> dialStatusDataCall(call3, &RCall::DialCancel);
       
  1599 	CleanupStack::PushL(dialStatusDataCall);
       
  1600 	call3.Dial(dialStatusDataCall, dataNumber);
       
  1601 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusDataCall, ETimeMedium), KErrNone, _L("RCall::Dial timed-out"));
       
  1602 	ASSERT_EQUALS(dialStatusDataCall.Int(), KErrNone,  _L("RCall::Dial returned with an error"));
       
  1603 
       
  1604 	// Check RMobileCall::NotifyMobileCallStatusChange on call 3 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1605 	RMobileCall::TMobileCallStatus expectedDataCallStatus = RMobileCall::EStatusDialling;
       
  1606 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1607 																		notifyDataCallStChange,
       
  1608 																		mobileCallStatusDataCall,
       
  1609 																		expectedDataCallStatus,
       
  1610 																		KErrNone);
       
  1611 	// Repost notifier
       
  1612 	call3.NotifyMobileCallStatusChange(notifyDataCallStChange, mobileCallStatusDataCall);
       
  1613 	expectedDataCallStatus = RMobileCall::EStatusConnecting;
       
  1614 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1615 																		notifyDataCallStChange,
       
  1616 																		mobileCallStatusDataCall,
       
  1617 																		expectedDataCallStatus,
       
  1618 																		KErrNone);
       
  1619 	// Repost notifier
       
  1620 	call3.NotifyMobileCallStatusChange(notifyDataCallStChange, mobileCallStatusDataCall);
       
  1621 	expectedDataCallStatus = RMobileCall::EStatusConnected;
       
  1622 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1623 																		notifyDataCallStChange,
       
  1624 																		mobileCallStatusDataCall,
       
  1625 																		expectedDataCallStatus,
       
  1626 																		KErrNone);
       
  1627 																		
       
  1628 	// ===  Dial an emergency call and check that it gets connected and call 3 is disconnected ===
       
  1629 	
       
  1630 	// Repost notifiers
       
  1631 	call3.NotifyMobileCallStatusChange(notifyDataCallStChange, mobileCallStatusDataCall);
       
  1632 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1633 	
       
  1634 	// Dial an emergency call on call 2 with RMobileCall::DialEmergencyCall 
       
  1635 	call2.DialEmergencyCall(dialStatusCall2, KEmergencyNumber112);
       
  1636 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall2, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed out"));
       
  1637 	ASSERT_EQUALS(dialStatusCall2.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall  returned with an error"));
       
  1638 	
       
  1639 	// Check RMobileCall::NotifyMobileCallStatusChange on call 2 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1640 	expectedMobileCall2Status = RMobileCall::EStatusDialling;
       
  1641 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1642 																		notifyCall2StChange,
       
  1643 																		mobileCall2Status,
       
  1644 																		expectedMobileCall2Status,
       
  1645 																		KErrNone);
       
  1646 	// Repost notifier
       
  1647 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1648 	expectedMobileCall2Status = RMobileCall::EStatusConnecting;
       
  1649 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1650 																		notifyCall2StChange,
       
  1651 																		mobileCall2Status,
       
  1652 																		expectedMobileCall2Status,
       
  1653 																		KErrNone);
       
  1654 	// Repost notifier
       
  1655 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1656 	expectedMobileCall2Status = RMobileCall::EStatusConnected;
       
  1657 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1658 																		notifyCall2StChange,
       
  1659 																		mobileCall2Status,
       
  1660 																		expectedMobileCall2Status,
       
  1661 																		KErrNone);
       
  1662 
       
  1663 	// Check RMobileCall::NotifyMobileCallStatusChange on call 3 completes with EStatusIdle
       
  1664 	expectedDataCallStatus = RMobileCall::EStatusIdle;
       
  1665 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1666 																		notifyDataCallStChange,
       
  1667 																		mobileCallStatusDataCall,
       
  1668 																		expectedDataCallStatus,
       
  1669 																		KErrNone);
       
  1670 
       
  1671 	// Repost notifier
       
  1672 	call2.NotifyMobileCallStatusChange(notifyCall2StChange, mobileCall2Status);
       
  1673 																		
       
  1674 	// Hang up call 2 with RCall::HangUp 
       
  1675 	call2.HangUp(hangUpStatus);
       
  1676 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeLong), KErrNone, _L("RCall::HangUp timed-out"));
       
  1677 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned an error"));	
       
  1678 	
       
  1679 	// Check RMobileCall::NotifyMobileCallStatusChange on call 2 completes with EStatusIdle
       
  1680 	expectedMobileCall2Status = RMobileCall::EStatusIdle;
       
  1681 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1682 																		notifyCall2StChange,
       
  1683 																		mobileCall2Status,
       
  1684 																		expectedMobileCall2Status,
       
  1685 																		KErrNone);
       
  1686 
       
  1687 	
       
  1688 	//
       
  1689 	// TEST END
       
  1690 	//
       
  1691 
       
  1692     StartCleanup();
       
  1693 	
       
  1694 	// Pop
       
  1695 	// notifyCallStChange
       
  1696 	// dialStatus
       
  1697 	// notifyCall2StChange
       
  1698 	// dialStatusCall2
       
  1699 	// hangUpStatus
       
  1700 	// notifyDataCallStChange
       
  1701 	// dialStatusDataCall
       
  1702 	CleanupStack::PopAndDestroy(7, &notifyCallStChange);
       
  1703 	
       
  1704 	return TestStepResult();
       
  1705 	}
       
  1706 
       
  1707 TPtrC CCTSYIntegrationTestCallEmergency0010::GetTestStepName()
       
  1708 /**
       
  1709  * @return The test step name.
       
  1710  */
       
  1711 	{
       
  1712 	return _L("CCTSYIntegrationTestCallEmergency0010");
       
  1713 	}
       
  1714 
       
  1715 
       
  1716 
       
  1717 CCTSYIntegrationTestCallEmergency0011::CCTSYIntegrationTestCallEmergency0011(CEtelSessionMgr& aEtelSessionMgr)
       
  1718 	: CCTSYIntegrationTestCallEmergencyBase(aEtelSessionMgr)
       
  1719 /**
       
  1720  * Constructor.
       
  1721  */
       
  1722 	{
       
  1723 	SetTestStepName(CCTSYIntegrationTestCallEmergency0011::GetTestStepName());
       
  1724 	}
       
  1725 
       
  1726 CCTSYIntegrationTestCallEmergency0011::~CCTSYIntegrationTestCallEmergency0011()
       
  1727 /**
       
  1728  * Destructor.
       
  1729  */
       
  1730 	{
       
  1731 	}
       
  1732 TVerdict CCTSYIntegrationTestCallEmergency0011::doTestStepL()
       
  1733 /**
       
  1734  * @SYMTestCaseID BA-CTSY-INT-CEMG-0011
       
  1735  * @SYMFssID BA/CTSY/CEMG-0011
       
  1736  * @SYMTestCaseDesc Dial Emergency Services at every stage of a conference call.
       
  1737  * @SYMTestPriority High
       
  1738  * @SYMTestActions RCall::HangUp, RMobileCall::GetMobileCallInfo, RMobileCall::NotifyMobileCallStatusChange, RCall::NotifyStatusChange, RMobileCall::DialEmergencyCall, RMobileConferenceCall::CreateConference, RMobileConferenceCall::HangUp
       
  1739  * @SYMTestExpectedResults Pass - Emergency call can be made at each stage of creating a conference.
       
  1740  * @SYMTestType CIT
       
  1741  * @SYMTestCaseDependencies simulated/manual
       
  1742  *
       
  1743  * Reason for test: Verify emergency call can be made at each stage of the conference.
       
  1744  *
       
  1745  * @return - TVerdict code
       
  1746  */
       
  1747 	{
       
  1748 
       
  1749 	//
       
  1750 	// SET UP
       
  1751 	//
       
  1752 
       
  1753 	// Check that the phone is registered with the network simulator. 
       
  1754     RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1755 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(phone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1756 	iNetworkTestHelper.CheckPhoneConnectedToAniteL(phone);
       
  1757 	
       
  1758     // Get voice line 1. 
       
  1759 	RMobileLine& line1 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1760 	
       
  1761 	// Get call 1. 
       
  1762 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
       
  1763 
       
  1764 	// Get Voice line 2. 
       
  1765 	RMobileLine& line2 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1766 
       
  1767 	// Get call 2. 
       
  1768 	RMobileCall& call2 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall2);
       
  1769 
       
  1770 	// Get voice line 3. 
       
  1771 	RMobileLine& line3 = iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  1772 	
       
  1773 	// Get call 3. 
       
  1774 	RMobileCall& call3 = iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall3);
       
  1775 
       
  1776 
       
  1777 	//
       
  1778 	// SET UP END
       
  1779 	//
       
  1780 	
       
  1781 	StartTest();
       
  1782 	
       
  1783 	//
       
  1784 	// TEST START
       
  1785 	//
       
  1786 	
       
  1787 	// Get the conference call subsession. 
       
  1788 	RMobileConferenceCall& confCall = iEtelSessionMgr.GetConferenceCallL(KMainServer,KMainPhone,KMainConferenceCall);
       
  1789     
       
  1790 	// ===  Dial an emergency call and hang up ===
       
  1791 
       
  1792     // Post notifier for RMobileCall::NotifyMobileCallStatusChange
       
  1793 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
  1794 	TExtEtelRequestStatus notifyCallStatusChange(call3, EMobileCallNotifyMobileCallStatusChange);
       
  1795 	CleanupStack::PushL(notifyCallStatusChange);
       
  1796 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1797 
       
  1798 	// Dial an emergency call on call 3 with RMobileCall::DialEmergencyCall to a number that answers
       
  1799 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10063 );
       
  1800 	TExtEtelRequestStatus dialStatusCall3(call3, EMobileCallDialEmergencyCall);
       
  1801 	CleanupStack::PushL(dialStatusCall3);
       
  1802 	call3.DialEmergencyCall(dialStatusCall3, KEmergencyNumber112);
       
  1803 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall3, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed out"));
       
  1804 	ASSERT_EQUALS(dialStatusCall3.Int(), KErrNone, _L(" RMobileCall::DialEmergencyCall returned with an error"));
       
  1805 
       
  1806 	// Check RMobileCall::NotifyMobileCallStatusChange on call 3 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1807 	RMobileCall::TMobileCallStatus expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
  1808 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1809 																		notifyCallStatusChange,
       
  1810 																		mobileCallStatus,
       
  1811 																		expectedMobileCallStatus,
       
  1812 																		KErrNone);
       
  1813 																		
       
  1814 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1815 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
  1816 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1817 																		notifyCallStatusChange,
       
  1818 																		mobileCallStatus,
       
  1819 																		expectedMobileCallStatus,
       
  1820 																		KErrNone);	
       
  1821 																																			
       
  1822 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1823 	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
  1824 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1825 																		notifyCallStatusChange,
       
  1826 																		mobileCallStatus,
       
  1827 																		expectedMobileCallStatus,
       
  1828 																		KErrNone);
       
  1829 
       
  1830 	// Check RMobileCall::GetMobileCallInfo on call 3 returns iEmergency = ETrue
       
  1831 	RMobileCall::TMobileCallInfoV1 mobileCallInfo;
       
  1832 	RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(mobileCallInfo);
       
  1833 	ASSERT_EQUALS(call3.GetMobileCallInfo(callInfoPckg), KErrNone, _L("RMobileCall::GetMobileCallInfo returned an error"));
       
  1834 	ASSERT_TRUE(mobileCallInfo.iEmergency, _L("RMobileCall::GetMobileCallInfo did not return ETrue for iEmergency"));
       
  1835 	
       
  1836 	// Hang up call 3 with RCall::HangUp 
       
  1837 	TCoreEtelRequestStatus<RMobileCall> hangUpStatus (call3, &RCall::HangUpCancel);	
       
  1838 	CleanupStack::PushL(hangUpStatus);
       
  1839 	call3.HangUp(hangUpStatus);
       
  1840 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out"));
       
  1841 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned with an error"));	
       
  1842 
       
  1843 	// ===  Dial first call in conference ===
       
  1844 
       
  1845 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange for call1
       
  1846 	RMobileCall::TMobileCallStatus mobileCallStatusCall1;
       
  1847 	TExtEtelRequestStatus notifyCallStatusChangeCall1(call1, EMobileCallNotifyMobileCallStatusChange);
       
  1848 	CleanupStack::PushL(notifyCallStatusChangeCall1);
       
  1849 	call1.NotifyMobileCallStatusChange(notifyCallStatusChangeCall1, mobileCallStatusCall1);
       
  1850 	
       
  1851 	// Dial a number that answers using call 1. 
       
  1852 	TPtrC number;
       
  1853 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1854 	TCoreEtelRequestStatus<RMobileCall> dialStatusCall1(call1, &RMobileCall::DialCancel);
       
  1855 	CleanupStack::PushL(dialStatusCall1);
       
  1856 	call1.Dial(dialStatusCall1, number);	
       
  1857     ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall1, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  1858 	ASSERT_EQUALS(dialStatusCall1.Int(), KErrNone, _L("RMobileCall::Dial returned with error."));
       
  1859 	
       
  1860 	// Check RCall::NotifyStatusChange for call 1 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1861 	RMobileCall::TMobileCallStatus expectedMobileCallStatusCall1 = RMobileCall::EStatusDialling;
       
  1862 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1863 																		notifyCallStatusChangeCall1,
       
  1864 																		mobileCallStatusCall1,
       
  1865 																		expectedMobileCallStatusCall1,
       
  1866 																		KErrNone);
       
  1867 																		
       
  1868 	call1.NotifyMobileCallStatusChange(notifyCallStatusChangeCall1, mobileCallStatusCall1);
       
  1869 	expectedMobileCallStatusCall1 = RMobileCall::EStatusConnecting;
       
  1870 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1871 																		notifyCallStatusChangeCall1,
       
  1872 																		mobileCallStatusCall1,
       
  1873 																		expectedMobileCallStatusCall1,
       
  1874 																		KErrNone);
       
  1875 																		
       
  1876 	call1.NotifyMobileCallStatusChange(notifyCallStatusChangeCall1, mobileCallStatusCall1);
       
  1877 	expectedMobileCallStatusCall1 = RMobileCall::EStatusConnected;
       
  1878 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1879 																		notifyCallStatusChangeCall1,
       
  1880 																		mobileCallStatusCall1,
       
  1881 																		expectedMobileCallStatusCall1,
       
  1882 																		KErrNone);
       
  1883 
       
  1884 	// ===  Dial an emergency call and hang up ===
       
  1885 
       
  1886 	// Repost notifier
       
  1887 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1888 	// Dial an emergency call on call 3 with RMobileCall::DialEmergencyCall to a number that answers
       
  1889 	call3.DialEmergencyCall(dialStatusCall3, KEmergencyNumber112);
       
  1890 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall3, ETimeLong), KErrNone,  _L("RMobileCall::DialEmergencyCall timed out"));
       
  1891 	ASSERT_EQUALS(dialStatusCall3.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall did not return KErrNone"));
       
  1892 
       
  1893 	// Check RMobileCall::NotifyMobileCallStatusChange on call 3 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1894 	 expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
  1895 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1896 																		notifyCallStatusChange,
       
  1897 																		mobileCallStatus,
       
  1898 																		expectedMobileCallStatus,
       
  1899 																		KErrNone);
       
  1900 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1901 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
  1902 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1903 																		notifyCallStatusChange,
       
  1904 																		mobileCallStatus,
       
  1905 																		expectedMobileCallStatus,
       
  1906 																		KErrNone);																		
       
  1907 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1908 	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
  1909 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  1910 																		notifyCallStatusChange,
       
  1911 																		mobileCallStatus,
       
  1912 																		expectedMobileCallStatus,
       
  1913 																		KErrNone);
       
  1914 
       
  1915 	// Check RMobileCall::GetMobileCallInfo on call 3 returns iEmergency = ETrue
       
  1916 	ASSERT_EQUALS(call3.GetMobileCallInfo(callInfoPckg), KErrNone, _L("RMobileCall::GetMobileCallInfo returned an error"));
       
  1917 	ASSERT_TRUE(mobileCallInfo.iEmergency, _L("RMobileCall::GetMobileCallInfo did not return ETrue for iEmergency"));
       
  1918 	
       
  1919 	// Hang up call 3 with RCall::HangUp 
       
  1920 	call3.HangUp(hangUpStatus);
       
  1921 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out"));
       
  1922 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned with an error"));	
       
  1923 	
       
  1924 	// Repost notifier
       
  1925 	call1.NotifyMobileCallStatusChange(notifyCallStatusChangeCall1, mobileCallStatusCall1);
       
  1926 	
       
  1927 	// Hold call 1. 
       
  1928 	TExtEtelRequestStatus holdStatus(call1, EMobileCallHold);
       
  1929 	CleanupStack::PushL(holdStatus);
       
  1930 	call1.Hold(holdStatus);
       
  1931 	ASSERT_EQUALS(WaitForRequestWithTimeOut(holdStatus, ETimeShort), KErrNone, _L("RMobileCall::Hold timed-out."));
       
  1932 	ASSERT_EQUALS(holdStatus.Int(), KErrNone, _L("RMobileCall::Hold returned with an error."));
       
  1933 
       
  1934 	// Check RMobileCall::NotifyMobileCallStatusChange for call 1 completes with EStatusHold
       
  1935 	expectedMobileCallStatusCall1 = RMobileCall::EStatusHold;
       
  1936 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call1,
       
  1937 															notifyCallStatusChangeCall1,
       
  1938 															mobileCallStatusCall1,
       
  1939 															expectedMobileCallStatusCall1,
       
  1940 															KErrNone);	
       
  1941 
       
  1942 	// ===  Dial second call in conference ===
       
  1943 
       
  1944 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange for call2
       
  1945 	RMobileCall::TMobileCallStatus mobileCallStatusCall2;
       
  1946 	TExtEtelRequestStatus notifyCallStatusChangeCall2(call2, EMobileCallNotifyMobileCallStatusChange);
       
  1947 	CleanupStack::PushL(notifyCallStatusChangeCall2);
       
  1948 	call2.NotifyMobileCallStatusChange(notifyCallStatusChangeCall2, mobileCallStatusCall2);
       
  1949 
       
  1950 	// Dial a number that answers using call 2. 
       
  1951 	TPtrC number2;
       
  1952 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber2, number2) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1953 	TCoreEtelRequestStatus<RMobileCall> dialStatusCall2(call2, &RMobileCall::DialCancel);
       
  1954 	CleanupStack::PushL(dialStatusCall2);
       
  1955 	call2.Dial(dialStatusCall2, number2);	
       
  1956     ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall2, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  1957 	ASSERT_EQUALS(dialStatusCall2.Int(), KErrNone, _L("RMobileCall::Dial returned with error."));
       
  1958 	
       
  1959 	
       
  1960 	// Check RCall::NotifyStatusChange for call 2 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  1961 	RMobileCall::TMobileCallStatus expectedMobileCallStatusCall2 = RMobileCall::EStatusDialling;
       
  1962 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1963 																		notifyCallStatusChangeCall2,
       
  1964 																		mobileCallStatusCall2,
       
  1965 																		expectedMobileCallStatusCall2,
       
  1966 																		KErrNone);
       
  1967 																		
       
  1968 	call2.NotifyMobileCallStatusChange(notifyCallStatusChangeCall2, mobileCallStatusCall2);
       
  1969 	expectedMobileCallStatusCall2 = RMobileCall::EStatusConnecting;
       
  1970 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1971 																		notifyCallStatusChangeCall2,
       
  1972 																		mobileCallStatusCall2,
       
  1973 																		expectedMobileCallStatusCall2,
       
  1974 																		KErrNone);
       
  1975 
       
  1976 	call2.NotifyMobileCallStatusChange(notifyCallStatusChangeCall2, mobileCallStatusCall2);
       
  1977 	expectedMobileCallStatusCall2 = RMobileCall::EStatusConnected;
       
  1978 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call2,
       
  1979 																		notifyCallStatusChangeCall2,
       
  1980 																		mobileCallStatusCall2,
       
  1981 																		expectedMobileCallStatusCall2,
       
  1982 																		KErrNone);
       
  1983 	
       
  1984 	// Create a conference with RMobileConferenceCall::CreateConference 
       
  1985 	TExtEtelRequestStatus createConferenceStatus(phone, EMobileConferenceCallCreateConference);
       
  1986 	CleanupStack::PushL(createConferenceStatus);
       
  1987 	confCall.CreateConference(createConferenceStatus);
       
  1988 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(createConferenceStatus, ETimeMedium), KErrNone, _L("RMobileConferenceCall::CreateConference timed out"));
       
  1989 	CHECK_EQUALS_L(createConferenceStatus.Int(), KErrNone, _L("RMobileConferenceCall::CreateConference returned with error"));
       
  1990 	
       
  1991 	// ===  Dial an emergency call and hang up ===
       
  1992 	
       
  1993 	// Repost notifier
       
  1994 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  1995 
       
  1996 	// Dial an emergency call on call 3 with RMobileCall::DialEmergencyCall to a number that answers
       
  1997 	call3.DialEmergencyCall(dialStatusCall3, KEmergencyNumber112);
       
  1998 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall3, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed out"));
       
  1999 	ASSERT_EQUALS(dialStatusCall3.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall did not return KErrNone"));
       
  2000 
       
  2001 	// Check RMobileCall::NotifyMobileCallStatusChange on call 3 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  2002 	expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
  2003 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  2004 																		notifyCallStatusChange,
       
  2005 																		mobileCallStatus,
       
  2006 																		expectedMobileCallStatus,
       
  2007 																		KErrNone);
       
  2008 
       
  2009 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  2010 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
  2011 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  2012 																		notifyCallStatusChange,
       
  2013 																		mobileCallStatus,
       
  2014 																		expectedMobileCallStatus,
       
  2015 																		KErrNone);																		
       
  2016 
       
  2017 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  2018 	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
  2019 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  2020 																		notifyCallStatusChange,
       
  2021 																		mobileCallStatus,
       
  2022 																		expectedMobileCallStatus,
       
  2023 																		KErrNone);
       
  2024 
       
  2025 	// Check RMobileCall::GetMobileCallInfo on call 3 returns iEmergency = ETrue
       
  2026 	ASSERT_EQUALS(call3.GetMobileCallInfo(callInfoPckg), KErrNone, _L("RMobileCall::GetMobileCallInfo returned an error"));
       
  2027 	ASSERT_TRUE(mobileCallInfo.iEmergency, _L("RMobileCall::GetMobileCallInfo did not return ETrue for iEmergency"));
       
  2028 	
       
  2029 	// Hang up call 3 with RCall::HangUp 
       
  2030 	call3.HangUp(hangUpStatus);
       
  2031 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out"));
       
  2032 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned with error"));	
       
  2033 
       
  2034 	// ===  Hang up conference ===
       
  2035 
       
  2036 	// Request notification for RMobileConferenceCall::NotifyConferenceStatusChange 
       
  2037 	TExtEtelRequestStatus notifyMobileConfStatusChangeStatus (confCall, EMobileConferenceCallNotifyConferenceStatusChange);
       
  2038 	CleanupStack::PushL(notifyMobileConfStatusChangeStatus);
       
  2039 	RMobileConferenceCall::TMobileConferenceStatus mobileConfStatus;
       
  2040 	confCall.NotifyConferenceStatusChange(notifyMobileConfStatusChangeStatus,mobileConfStatus);
       
  2041 	
       
  2042 	// Hang up conference call with RMobileConferenceCall::HangUp 
       
  2043 	TExtEtelRequestStatus hangUpStatusConfCall (confCall,EMobileConferenceCallHangUp);
       
  2044 	CleanupStack::PushL(hangUpStatusConfCall);		
       
  2045 	confCall.HangUp(hangUpStatusConfCall);
       
  2046 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatusConfCall, ETimeMedium), KErrNone, _L("RMobileConferenceCall::HangUp timed-out"));
       
  2047 	ASSERT_EQUALS(hangUpStatusConfCall.Int(), KErrNone,	_L("RMobileConferenceCall::HangUp returned with error"));
       
  2048 
       
  2049 	// Check RMobileConferenceCall::NotifyConferenceStatusChange completes with EConferenceIdle
       
  2050 	RMobileConferenceCall::TMobileConferenceStatus expectedConfStatus = RMobileConferenceCall::EConferenceIdle;
       
  2051 	iCallControlTestHelper.WaitForMobileConferenceCallNotifyConferenceStatusChange(confCall,
       
  2052 													 					notifyMobileConfStatusChangeStatus,
       
  2053 													 					mobileConfStatus,
       
  2054 													 					expectedConfStatus,
       
  2055 													 					KErrNone);
       
  2056 	
       
  2057 	// Release conference subsession 
       
  2058 	iEtelSessionMgr.ReleaseConferenceCall(KMainServer,KMainPhone,KMainConferenceCall);
       
  2059 
       
  2060 	// ===  Dial an emergency call and hang up ===
       
  2061 
       
  2062 	// Repost notifier
       
  2063 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  2064 
       
  2065 	// Dial an emergency call on call 3 with RMobileCall::DialEmergencyCall to a number that answers
       
  2066 	call3.DialEmergencyCall(dialStatusCall3, KEmergencyNumber112);
       
  2067 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatusCall3, ETimeMedium), KErrNone,  _L("RMobileCall::DialEmergencyCall timed out"));
       
  2068 	ASSERT_EQUALS(dialStatusCall3.Int(), KErrNone, _L("RMobileCall::DialEmergencyCall did not return KErrNone"));
       
  2069 
       
  2070 	// Check RMobileCall::NotifyMobileCallStatusChange on call 3 completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  2071 	expectedMobileCallStatus = RMobileCall::EStatusDialling;
       
  2072 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  2073 																		notifyCallStatusChange,
       
  2074 																		mobileCallStatus,
       
  2075 																		expectedMobileCallStatus,
       
  2076 																		KErrNone);
       
  2077  
       
  2078 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  2079 	expectedMobileCallStatus = RMobileCall::EStatusConnecting;
       
  2080 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  2081 																		notifyCallStatusChange,
       
  2082 																		mobileCallStatus,
       
  2083 																		expectedMobileCallStatus,
       
  2084 																		KErrNone);																		
       
  2085 	
       
  2086 	call3.NotifyMobileCallStatusChange(notifyCallStatusChange, mobileCallStatus);
       
  2087 	expectedMobileCallStatus = RMobileCall::EStatusConnected;
       
  2088 	iCallControlTestHelper.WaitForMobileCallNotifyMobileCallStatusChange(call3,
       
  2089 																		notifyCallStatusChange,
       
  2090 																		mobileCallStatus,
       
  2091 																		expectedMobileCallStatus,
       
  2092 																		KErrNone);
       
  2093 
       
  2094 	// Check RMobileCall::GetMobileCallInfo on call 3 returns iEmergency = ETrue
       
  2095 	ASSERT_EQUALS(call3.GetMobileCallInfo(callInfoPckg), KErrNone, _L("RMobileCall::GetMobileCallInfo returned an error"));
       
  2096 	ASSERT_TRUE(mobileCallInfo.iEmergency, _L("RMobileCall::GetMobileCallInfo did not return ETrue for iEmergency"));
       
  2097 	
       
  2098 	// Hang up call 3 with RCall::HangUp 
       
  2099 	call3.HangUp(hangUpStatus);
       
  2100 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone, _L("RCall::HangUp timed-out"));
       
  2101 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone, _L("RCall::HangUp returned with an error"));
       
  2102 	
       
  2103 	//
       
  2104 	// TEST END
       
  2105 	//
       
  2106 
       
  2107     StartCleanup();
       
  2108 	
       
  2109 	// Pop
       
  2110 	// notifyCallStatusChange
       
  2111 	// dialStatusCall3
       
  2112 	// hangUpStatus
       
  2113 	// notifyCallStatusChangeCall1
       
  2114 	// dialStatusCall1
       
  2115 	// holdStatus
       
  2116 	// notifyCallStatusChangeCall2
       
  2117 	// dialStatusCall2
       
  2118 	// createConferenceStatus
       
  2119 	// notifyMobileConfStatusChangeStatus
       
  2120 	// hangUpStatusConfCall
       
  2121 	
       
  2122 	CleanupStack::PopAndDestroy(11, &notifyCallStatusChange);
       
  2123 		
       
  2124 	return TestStepResult();
       
  2125 	}
       
  2126 
       
  2127 TPtrC CCTSYIntegrationTestCallEmergency0011::GetTestStepName()
       
  2128 /**
       
  2129  * @return The test step name.
       
  2130  */
       
  2131 	{
       
  2132 	return _L("CCTSYIntegrationTestCallEmergency0011");
       
  2133 	}
       
  2134 
       
  2135 
       
  2136