Intel 05-1832-002 IP Phone User Manual


 
384 Voice API for Windows Operating Systems Library Reference — November 2003
dx_sethook( ) — provide control of the hook switch status
dx_sethook( )
provide control of the hook switch status
!
!!
! Description
The dx_sethook( ) function provides control of the hook switch status of the specified channel. A
hook switch state may be either on-hook or off-hook.
Notes: 1. Do not call this function for a digital T-1 TDM bus configuration. Transparent signaling for TDM
bus digital interface devices is not supported.
2. Calling dx_sethook( ) with no parameters clears the loop current and silence history from the
channel’s buffers.
!
!!
! Asynchronous Operation
To run dx_sethook( ) asynchronously, set the mode field to EV_ASYNC. The function will return
0 to indicate it has initiated successfully, and will generate a termination event to indicate
completion. Use the Standard Runtime Library (SRL) Event Management functions to handle the
termination event.
Name: int dx_sethook(chdev, hookstate, mode)
Inputs: int chdev
valid channel device handle
int hookstate
hook state (on-hook or off-hook)
unsigned short mode
asynchronous/synchronous
Returns: 0 if successful
-1 if failure
Includes: srllib.h
dxxxlib.h
Category: Configuration
Mode: asynchronous or synchronous
Platform: Springware
Parameter Description
chdev specifies the valid channel device handle obtained when the channel was
opened using dx_open( )
hookstate forces the hookstate of the specified channel to on-hook or off-hook. The
following values can be specified:
DX_OFFHOOK – set to off-hook state
DX_ONHOOK – set to on-hook state
mode specifies whether to run dx_sethook( ) asynchronously or synchronously.
Specify one of the following:
EV_ASYNC – run dx_sethook( ) asynchronously
EV_SYNC – run dx_sethook( ) synchronously (default)