TSPI_phoneOpen

The TSPI_phoneOpen function opens the phone device whose device identifier is given, returning the service provider's opaque handle for the device and retaining TAPI's opaque handle for the device for use in subsequent calls to the PHONEEVENT procedure.

LONG TSPIAPI TSPI_phoneOpen(
  DWORD dwDeviceID,       
  HTAPIPHONE htPhone,     
  LPHDRVPHONE lphdPhone,  
  DWORD dwTSPIVersion,    
  PHONEEVENT lpfnEventProc
);

Parameters

  • dwDeviceID
    The phone device to be opened.
  • htPhone
    The TAPI opaque handle for the phone device to be used in subsequent calls to the PHONEEVENT callback procedure to identify the device.
  • lphdPhone
    A pointer to an HDRVPHONE where the service provider writes its handle for the phone device to be used by TAPI in subsequent calls to identify the device.
  • dwTSPIVersion
    The TSPI version negotiated through TSPI_phoneNegotiateTSPIVersion under which the service provider can operate.
  • lpfnEventProc
    A pointer to the PHONEEVENT callback procedure supplied by TAPI that the service provider calls to report subsequent events on the phone.

Return Values

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

PHONEERR_ALLOCATED, PHONEERR_NOMEM, PHONEERR_INCOMPATIBLEAPIVERSION, PHONEERR_RESOURCEUNAVAIL, PHONEERR_NODRIVER, PHONEERR_OPERATIONFAILED, PHONEERR_INUSE, PHONEERR_OPERATIONUNAVAIL, PHONEERR_INIFILECORRUPT.

Remarks

Opening a phone entitles TAPI to make further requests on the phone. The phone becomes active in the sense that the service provider can report asynchronous events such as hookswitch changes or button presses. The service provider reserves whatever nonsharable resources are required to manage the phone. For example, opening a phone accessed through a comm port and modem should result in opening the comm port, making it no longer available for use by other applications.

If the function succeeds, both TAPI and the service provider become committed to operating under the specified interface version number for this open device. Subsquent operations and events identified using the exchanged opaque phone handles conform to that interface version. This commitment and the validity of the handles remain in effect until TAPI closes the phone using the TSPI_PhoneClose function or until the service provider reports the PHONE_CLOSE event. If the function is not successful, no such commitment is made and the handles are not valid.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 3.0 and later Tapicomn.h   Coredll.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

TSPI_phoneClose, TSPI_phoneNegotiateTSPIVersion

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.