The programming model for the Telephony API is derived from the common Windows model with regard to device naming, using sections and entries in the SYSTEM.INI file and calling conventions. However, it deviates from this model in two major ways: (1) the application notification mechanism uses function callbacks in either the application's context or the interrupt handler's context, and (2) the synchronous/asynchronous operational model (described in the next section).
An application can chose between two notification mechanisms. Both mechanisms are based on function callbacks. When an event occurs, the application's callback function for that event is invoked. The API defines the parameter profile for these callbacks. The notification mechanisms differ in the thread from which the callback is made. Option one performs the callback at interrupt time in the interrupt handler's thread. While this provides the fastest response, the interrupt handler context provides a highly constrained execution environment in the sense that invoking most Windows API functions while in this context is highly likely to deadlock or crash the system. Option two invokes the same callback functions, but does so from within the application's thread, thereby providing a normal, full function execution environment where all Windows APIs can be safely invoked. Use of interrupt thread callbacks is strongly discouraged.