2.5.1.2 Phones

The Telephony SPI defines a device that supports the phone device class as one containing some or all of the following elements (or additional elements):

The Telephony SPI allows the TAPI DLL to monitor and/or control elements of the phone device on behalf of its client applications. Probably the most useful elements for an application to use are the hookswitch devices (e.g., to use the phone set as an audio I/O device to the PC) with volume control, gain control and mute, the ringer (for alerting the user), the data areas (for programming the phone), and perhaps the display (the PC's display is certainly a lot more capable). The application writer is discouraged from directly controlling or using phone lamps or phone buttons, since lamp and button capabilities can vary widely among phone sets, and applications can quickly become tailored to specific phone sets.

There is no guaranteed core set of services supported by all phone devices as there is for line devices (i.e., basic telephony services). Therefore, before an application can use a phone device, the application must first determine the exact capabilities of the phone device. Telephony capability varies with the configuration (e.g., client versus client/server), the telephone hardware and service provider software. Applications should make no assumptions as to what telephony capabilities are available. The TAPI DLL determines a phone's device capabilities on behalf of an application via TSPI_phoneGetDevCaps.

phoneGetDevCaps

Returns the device capabilities of a phone device.

A phone's device capabilities indicate which of these elements exist for each phone device present in the system and what their capabilities are. Although strongly oriented towards real-life telephone sets, this abstraction can provide a meaningful implementation (or subset thereof) for other devices as well. Take as an example a separate headset directly connected and controllable from the PC and operated as a phone device. Hookswitch changes can be triggered by detection of voice energy (offhook) or a period of silence (onhook); ringing can be emulated by the generation of an audible signal into the headset; a display can be emulated via text-to-speech conversion.

Note that a phone device need not be realized in hardware, but can instead be emulated in software, using a mouse or keyboard driven graphical command interface and the PC's speaker or sound system. Such a "soft phone" can be an application of the Telephony API. It can also be a service provider, which can be listed as a phone device available to applications via the SPI (i.e., it is assigned a phone device ID).

Depending on the environment and configuration, phone sets can be shared devices between the application and the switch. Some minor provision is made in the SPI where the switch may temporarily suspend the SPI's control of a phone device (see further).