/************************************************************
  Description: There is a call between A and B (tester).
               Participant A sends transfer request for B,
               who disconnects the original call and creates
               a new call to transfer target C.

  1. Call is created (between A and B)
  2. Call transfer request is received (Unattended)
  3. Incoming transfer is accepted
   	 Expected: Call is set to Transferring and then
   	 Connected state (Transfer completed)
	4. Hang up the original call
	5. Create a new MO PS call (B-C)
	6. Disconnect call
************************************************************/

[StifSettings]
CheckHeapBalance= on
[EndStifSettings]

[Test]
title 7.3 Transfer, Accept Unattended Transfer
timeout 15000
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

// SendPluginRequest TransferRequest (originatorCallID, isAttended(false/true), serviceID)
test SendPluginRequest TransferRequest 1 0 2
test WaitEvent 1 HandleTransfer 0 // parameter3: isAttended(boolean)

// Step 3
print Step_3

test AcceptTransfer 1 0 1 // CallID, RetVal, AcceptTransfer(boolean)
test WaitEvent 1 Transferring

// Step 4
print Step_4

test SendPluginRequest HangupCall 1
test WaitEvents 1 RemoteTerminated, 1 Disconnecting, 1 Idle
test Release 1 0

// Step 5
print Step_5

test OpenNewCall 2 0 TransferTargetAddress 2 ECCECallTypePS ECCELineTypePrimary

test Dial 2 0 SubAddress Bearer
test WaitEvent 2 Dialling
test WaitEvent 2 Connecting
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]
