/************************************************
	1. Create PS MT call [1]
		 Expected: Call goes to Ringing state
	2. Answer call
	3. Create PS MT call [1]
	   Expected: Call is Queued
	4. Hang Up call [1]
	5. Answer Queued call
	6. Hang up call
*************************************************/
[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 3.3.8 MT call, Queued, Hang up other call
timeout 15000
create ccetester test
test Delay 1000

// Step 1
print Step_1

// Trigger ICM
test InitIncomingCall

// Wait plugin to initialize
test Delay 1000

// Send plugin command (PS), MT call with CallID 1 is created
test SendPluginRequest CreateCall 2
test WaitEvent 0 IncomingCall
test WaitEvent 1 Ringing

// Step 2
print Step_2

test Answer 1 0
test WaitEvent 1 Answering
test WaitEvent 1 Connected

// Step 3
print Step_3

// Send plugin command, MT call with CallID 2 is created
test SendPluginRequest CreateCall 2
test WaitEvent 0 IncomingCall
test WaitEvent 2 Queued

// Step 4
print Step_4

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

// Step 5
print Step_5

test Answer 2 0
test WaitEvent 2 Answering
test WaitEvent 2 Connected

// Step 6
print Step_6

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

test VerifyTest
delete test
[Endtest] 
