/***************************************************
   1. Create MO PS call
   2. Incoming MT CS call
      Expected: Call goes to Queued state
   3. Answer MT call
      Expected: 1st call is automatically put on hold
   4. Hang up 2nd call
   5. Disconnect calls
***************************************************/

[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 3.3.5 MT call, Queue, Autohold
timeout 15000
create ccetester test
test Delay 1000

// Step 1
print Step_1

test OpenNewCall 1 0 "Test call Create MT call 3" 2 ECCECallTypePS ECCELineTypePrimary
test Dial 1 0 SubAddress Bearer
test WaitEvent 1 Dialling
test WaitEvent 1 Connecting
test WaitEvent 1 Connected

// Step 2
print Step_2

// Send plugin command (CS), MT call with CallID 2 is created
test SendPluginRequest 2 CreateCall 1
test WaitEvent 0 IncomingCall
test WaitEvent 2 Queued		//Call is queued even the other call is on hold

// Step 3
print Step_3

test Answer 2 0

test WaitEvents 1 Hold, 2 Answering, 2 Connected, 1 LocalHold

// 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 HangUp 1 0
test WaitEvent 1 Disconnecting
test WaitEvent 1 Idle
test Release 1 0

test VerifyTest
delete test
[Endtest] 
