A service provider is a dynamic-link library (DLL) that supports communications over a telephone network through a set of exported service functions. The service provider responds to telephony requests, sent to it by the TAPI, by carrying out the low-level tasks necessary to communicate over the telephone network. In this way, the service provider, in conjunction with TAPI, shields applications from the service- and technology-dependent details of the telephone network communication.
You write a service provider to extend telephony services for existing hardware or to provide telephony services for new hardware. Each service provider supports at least one hardware device, such as a fax board, an ISDN card, a telephone, or a modem. Some providers support a combination of devices. The installation utility for a service provider or the user associates a service provider with its hardware devices. Multiple service providers can be installed as long as they access different devices.
Each service provider is responsible for responding to telephony requests from TAPI to control line and phone devices. A service provider is also responsible for controlling and accessing the information exchanged over a call. To manage this information (called the media stream), the service provider must provide additional capabilities or functions. For example, a service provider that supports fax or data transmission must implement the TSPI functions that control and monitor the line over which data is sent. It must either implement functions that carry out the actual transmission of the data over the line or ensure that applications can use existing Win32 functions to carry out the transmission.
If a service provider implements its own functions to manage the media stream, it is recommended that the functions be based on standard Win32 functions, such as the communication or multimedia functions. For nonstandard or custom hardware devices, however, it may be best to develop a custom interface.
To access the actual device, a device driver is required. Although, in some cases, a service provider can contain a device-driver component, it is recommended that service providers either use existing device drivers, or develop the device driver as a separate, installable component.
The sample service provider, not intended to be a full-featured service provider, is the base on which you can develop more extensive service providers.
The variations to the standard DLL interface model that a service provider must observe are as follows: