/***************************************************
	 Description: Test basic operations with PS plugin

   1. Create MO call
   2. Put call on Hold
   3. Resume call
   4. Put on Hold again
   5. Create 2nd MO call
   6. Swap
   7. Send DTMF
   8. Disconnect calls
***************************************************/

[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 11.6 Misc, Basic Operations 1
timeout 20000
create ccetester test
test Delay 1000

// Step 1
print Step_1

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

// Step 2
print Step_2

test Hold 1 0
test WaitEvents 1 Hold, 1 LocalHold

// Step 3
print Step_3

test Resume 1 0
test WaitEvents 1 Connected, 1 LocalResume

// Step 4
print Step_4

test Hold 1 0
test WaitEvents 1 Hold, 1 LocalHold

// Step 5
print Step_5

test OpenNewCall 2 0 RecipientTwo 2 ECCECallTypePS ECCELineTypePrimary
test Dial 2 0 SubAddress Bearer
test WaitEvent 2 Dialling		// event 10
test WaitEvent 2 Connecting
test WaitEvent 2 Connected

// Step 6
print Step_6

//Swap connected call
test Swap 2 0

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

// Step 7
print Step_7

test StartDtmfTone 0 3
test WaitEvent 0 DtmfManualStart 0 3
test StopDtmfTone 0
test WaitEvent 0 DtmfManualStop 0 0

// Step 8
print Step_8

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

test HangUp 2 0
// CS Swap not completed, so it is cancelled
test WaitEvent 2 ErrorOccurred -3

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

test VerifyTest
delete test
[Endtest]
