/*************************************************
  1. Create conference of 2 calls
  2. Remove calls from conference
  	 Expected: Call is disconnected and
     conference ended
  3. Disconnect remaining call
**************************************************/

[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 9.2 Conference Call, Remove call
timeout 10000
create ccetester test
test Delay 1000

// Step 1
print Step_1

test OpenNewCall 1 0 Conf_A@172.23.123.29 2 ECCECallTypePS ECCELineTypePrimary
test Dial 1 0 SubAddress Bearer
test WaitEvent 1 Dialling
test WaitEvent 1 Connecting
test WaitEvent 1 Connected

test Hold 1 0
test WaitEvents 1 Hold, 1 LocalHold

test OpenNewCall 2 0 RecipientTwo 2 ECCECallTypePS ECCELineTypePrimary
test Dial 2 0 SubAddress Bearer
test WaitEvent 2 Dialling // step 5
test WaitEvent 2 Connecting
test WaitEvent 2 Connected

test AddToConference 1 0
test WaitEvent ConferenceCallAdded 1

test AddToConference 2 0
// Plugin sets call to match conference state (connected)
test WaitEvents ConferenceCallAdded 2, ConferenceActive, 1 Connected

// Step 2
print Step_2

test RemoveFromConference 1 0

// Plugin set call to idle
test WaitEvents ConferenceCallRemoved 1, 1 Disconnecting, 1 Idle, ConferenceCallRemoved 2, ConferenceIdle

// Call 1 should be disconnected
test HangUp 1 -11
test Release 1 0

// Step 3
print Step_3

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

test VerifyTest
delete test
[Endtest]
