ThbTapiPhone
Unit: hbTapi

Just as the line device component ThbTapiLine is an abstraction of a physical line device, the phone component ThbTapiPhone represents a device-independent abstraction of a telephone set. TAPI treats line and phone devices as devices that are independent of each other. In other words, you can use a phone (device) without using an associated line, and you can use a line (device) without using a phone.

A phone device is a device that includes some or all of the following elements:

Hookswitch Devices

A phone device can have multiple hookswitch devices. A hookswitch is the switch that connects or disconnects a device from the phone line. On a telephone, for example, this is the switch that is automatically activated when a user lifts the receiver from the cradle to get a new dial tone.

TAPI defines three types of hookswitch devices for a phone: handset, speakerphone, and headset. Each hookswitch device has a speaker and a microphone component, and operates in one of four hookswitch modes:

Onhook

The hookswitch device is onhook, and both its microphone and speaker are disabled.

Microphone only

The hookswitch device is offhook, its microphone is enabled, and its speaker is mute.

Speaker only

The hookswitch device is offhook, its microphone is mute, and its speaker is enabled.

Microphone and speaker

The hookswitch device is offhook, and both microphone and speaker are enabled.

Display

TAPI provides access to a phone's display. The display is modeled as an alphanumeric area with rows and columns. A phone's device capabilities indicate the size of a phone's display as the number of rows and the number of columns. Both these numbers are zero if the phone device does not have a display. Use the Display.Text property to to write information to the display of an open phone device and to retrieve the current contents of a phone's display.

When the display of a phone device is changed, a OnDisplay event is fired to notify the application about the state change.

Ringer

A single phone may be able to ring with different ring modes. Given the wide variety of ring modes available, ring modes are identified by means of their ring mode number. A ring mode number ranges from zero to the number of available ring modes minus one.

Use the Ringer property to control a phone device's ring mode and volume. When the ring mode/volume of a phone device is changed, the OnRingMode/OnRingVolume event is called to notify the application about the state change.

Phone Buttons / Lamps

TAPI models a phone's buttons and lamps as button-lamp pairs. A button with no lamp next to it or a lamp with no button is specified using a "dummy" indicator for the missing lamp or button. A button with multiple lamps is modeled by using multiple button-lamp pairs.

The lamps on a phone device can be lit in a variety of different lighting modes. Unlike ringing patterns, lamp modes are more uniform across phone sets of different vendors. A common set of lamp modes is defined by the API. A lamp identified by its lamp-button identifier can be lit in a given lamp mode. A lamp can also be queried for its current lamp mode.

Use the ThbTapiPhone.Controls property to control the buttons and lamps. When the state of a phone's button/lamp is changed, the OnButton/OnLamp event is called to notify the application about the state change.