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

[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 3.3.4 MT call, Queue, CS and CS
timeout 15000
create ccetester test
test Delay 1000

// Step 1
print Step_1

test OpenNewCall 1 0 Recipient@172.23.123.29 1 ECCECallTypeCSVoice 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

// Step 3
print Step_3

// Answer call
test Answer 2 0
// automatically put on hold
test WaitEvents 1 Hold, 2 Answering, 2 Connected, 1 LocalHold

// Step 4
print Step_4

// Hangup calls
test HangUp 1 0
test WaitEvent 1 Disconnecting
test WaitEvent 1 Idle
test Release 1 0

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

test VerifyTest
delete test
[Endtest] 
