| Platform SDK: TAPI |
The following code snippet demonstrates a call transfer.
Before using this code snippet, a call must be in progress, and you must perform the operations in Make a Call or Receive a Call.
Note This snippet does not have the error checking and releases appropriate for real code.
// From elsewhere in your code, you have obtained
// pAddress and pBasicCall, which are pointers to the
// ITAddress and ITBasicCallControl interfaces
// of the call in progress that will be transferred.
// Create the call object for transfer.
// bstrAddressToCall and dwAddressType
// have been retrieved from a UI.
ITBasicCallControl * pConsultCall
pAddress->CreateCall(
bstrAddressToCall,
dwAddressType,
&pConsultCall
);
// Start the transfer.
pBasicCall->Transfer(
pConsultCall,
VARIANT_TRUE
);
// Depending on the service provider,
// additional operations may be available
// or required.
// Finish the transfer.
pConsultCall->Finish(FM_ASTRANSFER);
// The consultation call transitions to CS_DISCONNECTED.
// The objects associated with pConsultCall and
// pBasicCall can be released immediately or
// used for information purposes and released later.