Click or drag to resize
TapiCallSetupTransfer Method
Initiates a transfer of the call. It establishes a consultation call, on which the destination of the transfer can be dialed.

Namespace: Traysoft.AddTapi
Assembly: Traysoft.AddTapi (in Traysoft.AddTapi.dll) Version: 6.0.0.1110
Syntax
public TapiCall SetupTransfer()

Return Value

Type: TapiCall
Temporary consultation call. When setting up a call for transfer, a consultation call is automatically created that enables Dial(String) to dial the number of the new transfer destination of the call. The originating party can carry on a conversation over this consultation call prior to completing the transfer.
Exceptions
ExceptionCondition
TapiExceptionSetup transfer failed because a TAPI error occurred.
Remarks

The setup phase of a transfer establishes a consultation call that enables the application to send the number of the destination (the party to be transferred to) to the switch, while the call to be transferred is kept on hold. This new call is referred to as a consultation call and can be disconnected or otherwise manipulated independently of the original call.

When the consultation call has reached the DialTone state, the application can proceed transferring the call either by dialing the destination number using Dial(String) and tracking the call progress, or by unholding an existing call. The transfer of the original call to the selected destination is completed using CompleteTransfer(TapiCall, Boolean).

While the consultation call exists, the original call typically transitions to the OnHoldPendingTransfer state. The application may be able to toggle between the consultation call and the original call by using SwapHold(TapiCall). A consultation call can be canceled using Disconnect on it. After dropping a consultation call, the original call typically transitions back to the connected state. If the call state of the original call is OnHoldPendingTransfer, the Unhold can be used to recover the call. In this case, the consultation call is destroyed.

The application can also transfer calls in a single step, without having to deal with the intervening consultation call, by using Transfer(String).

Examples
The following code shows how to perform a 2-step or consultation call transfer. Error handling has been omitted for clarity.
// Assuming activeCall represents an active call in Connected state
// The remote party on that call will be transferred to extension 201

// First step: create consultation call and dial ext. 201
TapiCall consultationCall = activeCall.SetupTransfer();
System.Threading.Thread.Sleep(500);
if (consultationCall.State != TapiCallState.DialTone) throw new Exception("Call state is not Dialtone");
consultationCall.Dial("201");
// When the state of the consultation call changes to Connected, the user can talk to ext. 201
// before transferring the remote party to ext. 201
...
// Second step: complete the transfer
activeCall.CompleteTransfer(consultationCall, false);
// Now the remote party of the active call can talk to ext. 201
// The user's line is free to accept new calls
See Also