Application Message Notification Mechanisms

TAPI version 2.0 and later support three mechanisms for notifying applications of changes in the status of calls, lines, and phones: a callback function, Win32 events, and completion ports. For detailed descriptions of these mechanisms, see lineInitializeEx and phoneInitializeEx.

Prior to TAPI version 2.0, only one such mechanism existed: the callback function. When the callback mechanism is used, the application's callback function is invoked from within the application's thread (at the time the application calls the GetMessage function), providing a normal, fully functional execution environment in which all Win32 APIs can be safely invoked.

A LINE_REPLY or PHONE_REPLY (asynchronous completion) message sent to the application carries the request identifier and an error indication. Valid error indications for this reply are identical to those that are returned synchronously for the associated request, or zero for success. Only the application that issued the request will receive the reply message, but when the request causes changes in the state of the device or call, other interested applications may also receive event-related messages.

TAPI guarantees that a reply message is made for every request that operates asynchronously, unless the application shuts down TAPI (by calling lineShutdown or phoneShutdown) before the reply is received.