TSPI_phoneSetHookSwitch

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.

LONG 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 the following PHONEHOOKSWITCHDEV_ constants:
PHONEHOOKSWITCHDEV_HANDSET
The phone's handset.
PHONEHOOKSWITCHDEV_SPEAKER
The phone's speakerphone or adjunct.
PHONEHOOKSWITCHDEV_HEADSET
The phone's headset.
dwHookSwitchMode
The hookswitch mode to set. This parameter can have only one of the following PHONEHOOKSWITCHMODE_ bits set:
PHONEHOOKSWITCHMODE_ONHOOK
The device's microphone and speaker are both onhook.
PHONEHOOKSWITCHMODE_MIC
The device's microphone is active, and the speaker is mute.
PHONEHOOKSWITCHMODE_SPEAKER
The device's speaker is active, and the microphone is mute.
PHONEHOOKSWITCHMODE_MICSPEAKER
The device's microphone and speaker are both active.

Return Values

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.

See Also

PHONE_STATE, PHONESTATUS, PHONEHOOKSWITCHDEV_ Constants, PHONEHOOKSWITCHMODE_ Constants, TSPI_phoneGetHookSwitch