Avaya 1.3 User Manual

Page of 256
Using the TSAPI SDK
192 Installation Guide
TSAPI Sample Code
In a Windows installation, the sample code can be located through the Avaya Computer 
Telephony TSAPI SDK entry in the Start menu. The TSAPI samples provided are complete 
applications that demonstrate how to program to TSAPI. Each of these samples builds on 
the next, with each one implementing more TSAPI functionality than the previous one. 
These samples were all written in C++ and built using the Microsoft Developer Studio and 
the Microsoft Foundation Classes (MFC). The makefiles (*.MDP and *.MAK) provided with 
this sample are specific to that development environment. However, no complex C++ or 
MFC techniques were used and there are comments explaining the MFC code to non-MFC 
folks.
Porting this code to other platforms will require modifications to event notification.
These samples build on each other in the following order:
1. TSAPIOUT - TSAPI Outgoing Call Handling
1 device, 1 call Shows basic outgoing call handling for a single device and a single call 
with no redirection, conferencing, transferring, etc. Includes making a call and hanging 
up the call.
2. TSAPIIN - TSAPI Incoming Call Handling
1 device, 1 call Adds incoming call handling to sample 1. Still no redirection, 
conferencing, etc. It demonstrates differentiating between incoming calls and outgoing 
calls. Includes answering calls.
3. TSAPIMUL - TSAPI Multiple Call Handling
1 device, many calls Adds multiple call handling to sample 2. It demonstrates how to 
keep track of multiple calls at the same device. Includes holding and retrieving calls. 
Also includes redirection as a bonus.
4. TSAPICNF - TSAPI Conference Call Handling
1 device, many calls Adds conference/transfer handling to sample 3. Includes tracking 
of many connections on a single call.
The following files are common to all of the samples:
TSAPI.CPP
TSAPI.H
helper classes for tracking devices and calls and routines for  retrieving TSAPI events 
from the CSTA DLL
OPENTSRV.CPP
OPENTSRV.H
supports the Open Tserver dialog; authorizes the user, opens the TSAPI stream and 
registers the selected device with the TSAPI helper classes.