28 Voice API Programming Guide — June 2005
Event HandlingEach of the event management functions applicable to the voice boards are listed in the following tables. Table1 lists values that are required by event management functions. Table 2 list values that are returned for event management functions that are used with voice devices. Table1. Voice Device Inputs for Event Management FunctionsEvent Management
Function
Voice Device
Input Valid Value Related Voice Functions
sr_enbhdlr()
Enable event handler
evt_type TDX_PLAY dx_play()
TDX_PLAYTONE dx_playtone()
TDX_RECORD dx_rec()
TDX_GETDIG dx_getdig()
TDX_DIAL dx_dial()
TDX_CALLP dx_dial()
TDX_SETHOOK dx_sethook()
TDX_WINK dx_wink()
TDX_ERROR All asynchronous functions
sr_dishdlr()
Disable event handler
evt_type As above As above
Table2. Voice Device Returns from Event Management FunctionsEvent Management
Function
Return
Description Returned Value Related Voice Functions
sr_getevtdev()
Get device handle
device voice device handle
sr_getevttype()
Get event type
event type TDX_PLAY dx_play()
TDX_PLAYTONE dx_playtone()
TDX_RECORD dx_rec()
TDX_GETDIG dx_getdig()
TDX_DIAL dx_dial()
TDX_CALLP dx_dial()
TDX_CST dx_setevtmsk()
TDX_SETHOOK dx_sethook()
TDX_WINK dx_wink()
TDX_ERROR All asynchronous functions
sr_getevtlen()
Get event data length
event length sizeof (DX_CST)
sr_getevtdatap()
Get pointer to event data
event data pointer to DX_CST structure