Make a Call

The following code example demonstrates how to create a call object, discover the streams associated with the call, select and create appropriate terminals, select the terminals onto the streams, and complete the connection.

Before using this code example, you must perform the operations in Initialize TAPI and Select an Address.

Also, you must perform the operations illustrated in Select a Terminal following the call to ITAddress::CreateCall.


This example does not have the error checking and releases appropriate for production code.


// Specify the destination address.
// szAddressToCall and 
// dwAddressType have been
// retrieved from a user interface.
ITBasicCallControl * pBasicCall
bstrAddressToCall = SysAllocString( szAddressToCall );
// If ( bstrAddressToCall == NULL ) process the error here. 

HRESULT hr = pAddress->CreateCall(
// If ( hr != S_OK ) process the error here. 


// Create the required terminals for this call.
    // See the Select a Terminal code example.

// Make the connection.
pBasicCall->Connect( TRUE );