/***************************************************
	 1. Trigger ICM to load PS plugin
   2. Create MT PS call
   3. Put call on Hold
   4. Create 2nd (MT PS) call
   5. Hang up 2nd call
   6. Resume 1st call
   7. Hang up 1st call
/***************************************************/

[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 8.1.9 Two calls, MT/PS and MT/PS
timeout 10000
create ccetester test
test Delay 1000

// Step 1
print Step_1

test InitIncomingCall
//Wait plugin to initialize:
test Delay 1000

// Step 2
print Step_2

// Plugin 1 = PS plugin (default if not given)
// Plugin 2 = CS plugin

test SendPluginRequest CreateCall 2
test WaitEvent 0 IncomingCall
test WaitEvent 1 Ringing
// Answer call
test Answer 1 0
test WaitEvent 1 Answering
test WaitEvent 1 Connected

// Step 2
print Step_2

test Hold 1 0
test WaitEvents 1 Hold, 1 LocalHold

// Step 3
print Step_3

test SendPluginRequest CreateCall 2
test WaitEvent 0 IncomingCall
test WaitEvent 2 Queued
// Answer call
test Answer 2 0
test WaitEvent 2 Answering
test WaitEvent 2 Connected

// Step 4
print Step_4

test HangUp 2 0
test WaitEvent 2 Disconnecting
test WaitEvent 2 Idle
test Release 2 0

// Step 5
print Step_5

test Resume 1 0
test WaitEvents 1 Connected, 1 LocalResume

// Step 6
print Step_6

test HangUp 1 0
test WaitEvent 1 Disconnecting
test WaitEvent 1 Idle
test Release 1 0

test VerifyTest
delete test
[Endtest]
