The Telephony Application Programming Interface (TAPI) is a collection of DLLs and a documented programming interface for centralizing and controlling telephony communications services. TAPI was developed by Microsoft primarily for Computer Telephony Integration (CTI) applications. TAPI provides the services that telephone equipment and system providers need to integrate Windows programming and telephone hardware.
TAPI also provides a smaller, though much more visible, service in managing modems as system devices. This is a tremendous boon to communications programmers. No longer do communications applications need to search serial ports for modems, try to identify modems, burden the user with questions about their modem, or try any of the other traditional approaches to supporting modems. Under TAPI, that task is handled by the operating system. Programs make a few simple TAPI calls to determine what modems are available.
Another advantage of TAPI is that applications can share serial ports. For example, assume that an application opens a TAPI device to accept incoming fax or data calls. A second application, if it also uses TAPI, can safely open the same TAPI device for an outgoing call. When the outgoing call is over, TAPI resumes monitoring incoming calls without any further action required by either application.
Async Professional provides components that make use of TAPI modem management. These components provide an alternate to TAdModem for configuring modems and dialing and answering calls. Async Professional negotiates for TAPI 1.4 in Windows applications.
The Async Professional TAPI components provide all the services necessary for selecting TAPI devices, dialing and answering calls, and receiving status information about TAPI calls in progress.
Without TAPI, the TApdComPort component opens the physical serial port directly using the appropriate Windows API call, which returns a handle to that port. The TApdComPort then uses the handle to send and receive data and otherwise control the serial port. Configuring, dialing or answering the modem requires sending explicit ATXxx commands to the modem, interpreting the responses, and dealing with the myriad of differences among currently available modems.
With TAPI, a TApdComPort is still required, but it is not initially involved in establishing the modem connection—a TApdTapiDevice is used for that purpose. The application calls Dial to place an outgoing call or calls AutoAnswer to wait for an incoming call. TAPI sends the appropriate ATXxx commands, interprets the responses, and establishes the modem connection.
Once the connection is established, TAPI’s role is essentially over. TAPI remains in charge of the call until the modem connection is broken, but the TApdTapiDevice is not used again. From this point on you use the TApdComPort to control the port and send/receive data, just as if TAPI is not involved. The TApdComPort is automatically opened by the TApdTapiDevice when the modem connection is established. Several TApdComPort properties are updated with appropriate information from the TAPI device, notably Baud and ComNumber.
When the modem connection is broken, TApdTapiDevice automatically closes the associated TApdComPort. The TApdComPort cannot be used for input/output unless the modem connection is re-established by the TAPI device or unless the program bypasses TAPI and opens and uses the TApdComPort directly.
This document maintained by the Async Professional Project.