Platform SDK: TAPI

Event Notification

Event notification is the primary means by which an application gets information from TAPI and the service providers. This information may be the status of an asynchronous operation instigated by the application or may concern a process that started outside of the application, such as notifications of new incoming calls.

TAPI 2 applications handle notification in one of three ways: Hidden Window, Event Handle, or Completion Port. For additional information on these notification mechanisms, please see the Remarks section for lineInitializeEx. An application specifies the mechanism by setting the dwOptions member of the LINEINITIALIZEEXPARAMS structure prior to calling lineInitializeEx.

The lineSetStatusMessages function enables an application to specify which notification messages to receive for events related to status changes for the specified line or any of its addresses.

TAPI 3 applications handle general notification using COM standard connectable objects. ITTAPIEventNotification is the outgoing interface that must be registered with TAPI's container object, and ITTAPIEventNotification::Event is the method TAPI calls to determine the application's response. The ITTAPI::put_EventFilter method tells TAPI which events are of interest to the application. If an event filter is not entered, the application will not receive notification of any events. The ITTAPI::RegisterCallNotifications method tells TAPI the media types and addresses for which the application will handle incoming sessions. For additional information on TAPI 3 event handling, please see the Events overview or the Register Events code snippet.

Telephony service providers implement TSPI_lineSetDefaultMediaDetection and TSPI_lineSetStatusMessages. TAPI calls these functions to indicate the set of all line, address, and media type events requested by applications.