TAPI - Inititalising an application’s use of Tapi.dll

lineInitialize()

Initialise an application’s use of Tapi.dll


SYNTAX

lineInitialize(CallBack [, AppName])

This function initialises the application’s use of Tapi.dll for subsequent use of the line abstraction. The function registers the application’s specified notification mechanism and returns the number of line devices available to the application. A line device is any device that provides an implementation for the line-prefixed functions in TAPI.

Upon successful completion of the lineInitialize() request, the function:

tapiGetValue(TAPI_VAR_NUMDEVS)

returns the number of line devices available to the application.

CallBack

Name of the function to be used as a callback. The function will be invoked to determine status and events on the line device, addresses, or calls.

The arguments to the callback function are as follows:

func_id(DevID, Msg, CallbackInstance, Param1, Param2, Param3)

DevID

Integer identifying a line device or a call associated with the callback. The nature of this handle (line handle or call handle) can be determined by the context provided by the Msg parameter.

Msg

Integer containing the line or call device message.

CallbackInstance

Integer containing callback instance data passed back to the application in the callback. This parameter is not interpreted by TAPI.

Param1 - Param3

AppName

Optional alphanumeric parameter, supplying a name for the application. The intention is to provide a user-friendly indication of the application that originated, or originally accepted or answered the call. This information can be useful for call-logging purposes. AppName should contain displayable characters only. If this parameter is not provided, the application’s file name is used instead.


EXAMPLE

!define MAX_DEV 16

!temp RC,,i4
!temp NDevs,,i4

     tmp.RC = lineInitialize(fnTapiCallback, "TAPI Test")
     tmp.NDevs = tapiGetValue(TAPI_VAR_NUMDEVS)
     if (tmp.NDevs >= MAX_DEV) {
          info "Application is not ready for so many devices"
          exit
}

RELATED TOPICS

TAPI