Platform SDK: TAPI

TSPI_lineOpen

The TSPI_lineOpen function opens the line device whose device identifier is given, returning the service provider's handle for the device. The service provider must retain the TAPI handle for the device for use in subsequent calls to the LINEEVENT callback procedure.

LONG TSPIAPI TSPI_lineOpen(
  DWORD dwDeviceID,     
  HTAPILINE htLine,     
  LPHDRVLINE lphdLine,  
  DWORD dwTSPIVersion,  
  LINEEVENT lpfnEventProc  
);

Parameters

dwDeviceID
Identifies the line device to be opened.
htLine
The TAPI handle for the line device to be used in subsequent calls to the LINEEVENT callback procedure to identify the device.
lphdLine
A pointer to an HDRVLINE where the service provider fills in its handle for the line device.
dwTSPIVersion
The TSPI version.
lpfnEventProc
A pointer to the LINEEVENT callback procedure supplied by TAPI that the service provider calls to report subsequent events on the line.

Return Values

Returns zero if the function succeeds, or an error number if an error occurs. Possible return values are as follows:

LINEERR_ALLOCATED, LINEERR_OPERATIONUNAVAIL, LINEERR_NODRIVER, LINEERR_OPERATIONFAILED, LINEERR_NOMEM, LINEERR_RESOURCEUNAVAIL.

Remarks

The service provider should reserve any non-sharable resources that are required to manage the line. However, any actions that can be postponed to lineMakeCall should be. It is a design assumption in TAPI that lineOpen is an "inexpensive" operation. For example, if the line is opened in monitor mode only, it should not be necessary for a COMM-port-based service provider to open the COMM port.

This procedure does not correspond directly to any procedure at the TAPI level, at which the functions of enabling device-specific extensions, selecting line characteristics, and setting media type detection are included in the functionality defined by lineOpen. At the TSPI level, these additional capabilities are separated out into TSPI_lineNegotiateExtVersion, TSPI_lineSetDefaultMediaDetection and TSPI_lineConditionalMediaDetection.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later.
  Version: Requires TAPI 1.3 or later.
  Header: Declared in Tspi.h.

See Also

LINE_CLOSE, LINEEVENT, TSPI_lineClose, TSPI_lineConditionalMediaDetection, TSPI_lineNegotiateExtVersion, TSPI_lineNegotiateTSPIVersion, TSPI_lineSetDefaultMediaDetection