TAPI - Querying a line device to determine its telephony capabilities

lineGetDevCaps()

Query a line device to determine its telephony capabilities


SYNTAX

lineGetDevCaps(DeviceID)

This function queries a specified line device to determine its telephony capabilities. The returned information is valid for all addresses on the line device.

The DeviceID is an integer value, containing the number of the line device.

The tapiGetValue() function returns the value or values required, using the following form:

tapiGetValue(TAPI_VAR_DEVCAPS, value)

The function should be called once for each value required.

The values that may be returned are:

TAPI_FLD_PROVIDER_INFO

Upon successful completion, returns a string providing information about the provider hardware and/or software, such as the vendor name and version numbers. This information can be useful when a user needs to call customer service with problems relating to the provider or to the media modes of the device.

TAPI_FLD_SWITCH_INFO

Upon successful completion, returns a string providing information about the switch to which the line device is connected, such as the switch manufacturer, the model name and the software version. This information can be useful when a user needs to call customer service with problems regarding the switch.

TAPI_FLD_PERMANENT_LINE_ID

Upon successful completion, returns an i4 value providing the permanent identifier by which the line device is known in the system’s configuration. This is a permanent name for the line device. In contrast to DeviceID, it does not change as lines are added or removed from the system, and persists through operating system upgrades. It can therefore be used to link line-specific information in files such as .ini files, in a way that is not affected by adding or removing other lines, or by changing the operating system.

TAPI_FLD_LINE_NAME

Upon successful completion, returns a string containing a user configurable name for this line device. This name can be set by the user when configuring the line device’s service provider, and is provided for the user’s convenience.

TAPI_FLD_BEARER_MODES

Upon successful completion, returns an i4 value containing a flag array indicating the different bearer modes the address is able to support.

TAPI_FLD_MAX_RATE

Upon successful completion, returns an i4 value containing the maximum data rate, in bits per second, for information exchange over the call.

TAPI_FLD_MEDIA_MODES

Upon successful completion, returns an i4 value containing a flag array indicating the different media types the address is able to support.

TAPI_FLD_LINE_FEATURES

Upon successful completion, returns an i4 value specifying the features available for this line. Invoking a supported feature requires the line to be in the proper state and the underlying line device to be opened in a compatible mode. A zero in a bit position indicates that the corresponding feature is never available. A one indicates that the corresponding feature may be available if the line is in the appropriate state for the operation to be meaningful. This allows an application to discover which line features can be (and which can never be) supported by the device.


EXAMPLE

!temp Dev,,i4
!temp NDevs,,i4
!temp ProviderInfo,,a128[MAX_DEV]
!temp SwitchInfo,,a128[MAX_DEV]
!temp PermanentLineID,,a128[MAX_DEV]
!temp LineName,,a128[MAX_DEV]
!temp MediaModes,,i4[MAX_DEV]

     for (tmp.Dev = 0; tmp.Dev < tmp.NDevs; tmp.Dev = tmp.Dev + 1) {

          tmpRC = lineGetDevCaps(tmp.Dev)
          tmp.ProviderInfo[tmpDev + 1] = tapiGetValue(TAPI_VAR_DEVCAPS, \
               TAPI_FLD_PROVIDER_INFO, tmp.Dev)
          tmp.SwitchInfo[tmpDev + 1] = tapiGetValue(TAPI_VAR_DEVCAPS, \
               TAPI_FLD_SWITCH_INFO, tmp.Dev)
          tmp.PermanentLineID[tmpDev + 1] = tapiGetValue(TAPI_VAR_DEVCAPS, \
               TAPI_FLD_PERMANENT_LINE_ID, tmp.Dev)
          tmp.MediaModes[tmpDev + 1] = tapiGetValue(TAPI_VAR_DEVCAPS, \
               TAPI_FLD_MEDIA_MODES, tmp.Dev)
          tmp.LineName[tmpDev + 1] = tapiGetValue(TAPI_VAR_DEVCAPS,\
               TAPI_FLD_LINE_NAME, tmp.Dev)
     }

RELATED TOPICS

TAPI