2.5.1.1 Phone SPI Initialization

As part of the using the phone device abstraction defined by the TSPI, the TAPI DLL and Service Provider must first go through some basic initialization. The first of these steps is interface version negotiation. The TAPI DLL performs this by calling the TSPI_phoneNegotiateTSPIVersion function. This function is usually used to negotiate on behalf of an individual phone device; different phone devices within the same Service Provider may operate according to different interface versions. The TAPI DLL passes a special reserved device ID value, INITIALIZE_NEGOTIATION, to indicate that it is negotiating an overall interface version for early initialization functions that affect all phone devices.

The result of this negotiation is passed to subsequent procedures until a phone device is opened. At that time, the phone device becomes committed to a particular interface version. This interface version is implicit until the phone is closed, and does not need to be passed to subsequent functions that operate on an opened phone.

Another minor function that may be called early in initialization is TSPI_phoneGetProcTable. This procedure retrieves pointers to all of the phone-related procedures defined by the TSPI and implemented by the Service Provider. In principle, the TAPI DLL should load all of these procedure pointers by name using the usual library-management procedures supplied by Windows to do so. In fact, the Service Provider is required to EXPORT all of its entry point procedures to support such an approach. In practice, this may be a very slow operation, so TSPI_phoneGetProcTable is supplied as an alternate optimization.

The next major step in initialization is TSPI_phoneSetDeviceIDBase. Devices of the Telephony "phone" device class are identified by integers starting from zero. This range of identifiers is contiguous across the full range of phone devices. Since there may be multiple Service Providers managing phone devices in a single system, each Service Provider gets a contiguous portion of the total range. The TSPI_phoneSetDeviceIDBase function tells the Service Provider the lowest value in its portion of the range. The Service Provider, rather than the TAPI DLL, has the responsibility for mapping this variable range to its own internal device identifiers. This gives the Service Provider vendor sufficient flexibility to use device IDs in device-specific extensions if it so desires. Since the Service Provider "knows" what device IDs appear in the TAPI-defined parameters and data structures, it can use consistent device IDs in device-specific extension parameters and data structures.

TSPI_phoneNegotiateTSPIVersion

Negotiates an interface version number for early-initialization functions that may be called before a phone is opened.

TSPI_phoneGetProcTable

Retrieves pointers to all the phone-related procedures defined by the TSPI and implemented by the Service Provider.

TSPI_phoneSetDeviceIDBase

Sets the base of the Service Provider's contiguous range of phone device IDs.

All of these functions operate strictly asynchronously.