TSPI_phoneSetHookSwitch function (tspi.h)

The TSPI_phoneSetHookSwitch function sets the hook state of the specified open phone's hookswitch devices to the specified mode. Only the hookswitch state of the hookswitch devices listed is affected.

Syntax

LONG TSPIAPI TSPI_phoneSetHookSwitch(
  DRV_REQUESTID dwRequestID,
  HDRVPHONE     hdPhone,
  DWORD         dwHookSwitchDevs,
  DWORD         dwHookSwitchMode
);

Parameters

dwRequestID

The identifier of the asynchronous request.

hdPhone

The handle to the phone containing the hookswitch devices whose modes are to be set.

dwHookSwitchDevs

The device(s) whose hookswitch mode is to be set. This parameter uses one of the PHONEHOOKSWITCHDEV_ constants.

dwHookSwitchMode

The hookswitch mode to set. This parameter can have only one of the PHONEHOOKSWITCHMODE_ constants.

Return value

Returns dwRequestID or an error number if an error occurs. The lResult actual parameter of the corresponding ASYNC_COMPLETION is zero if the function succeeds or it is an error number if an error occurs. Possible return values are as follows:

PHONEERR_INVALPHONEHANDLE, PHONEERR_NOMEM, PHONEERR_INVALHOOKSWITCHDEV, PHONEERR_RESOURCEUNAVAIL, PHONEERR_INVALHOOKSWITCHMODE, PHONEERR_OPERATIONFAILED, PHONEERR_INVALPHONESTATE, PHONEERR_OPERATIONUNAVAIL.

Remarks

The hookswitch mode is changed to the indicated setting for all devices specified. If different settings are desired, this function can be invoked multiple times with a different set of parameters. A PHONE_STATE message is sent to the application after the hookswitch state has changed.

Requirements

Requirement Value
Target Platform Windows
Header tspi.h

See also

PHONEHOOKSWITCHDEV_ Constants

PHONEHOOKSWITCHMODE_ Constants

PHONESTATUS

PHONE_STATE

TSPI_phoneGetHookSwitch