After performing basic initialization and possibly having retrieved device capabilities, tapi32.dll must open the line device before it can access telephony functions on that line. When a line device is opened successfully, tapi32.dll is returned a handle representing the open line. The TSPI_lineOpen function opens a specified line device for providing subsequent monitoring and/or control of the line. TSPI_lineClose closes a specified line device.
At the TAPI level, a line device can be specified to lineOpen in one of two ways:
To support LINEMAPPER selection of lines, the service provider must implement the TSPI_lineConditionalMediaDetection function. This function does two things: (1) it tests a line's ability to support the requested call parameters and media mode, and (2) if successful, it commits the service provider to monitoring for the new media mode. The tapi32.dll uses this function for different line devices to hunt for a line that meets the application's Open requirements.