Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 443
wait for a specified number of rings — dx_wtring( )
dx_wtring( )
wait for a specified number of rings
!
!!
! Description
The dx_wtring( ) function waits for a specified number of rings and sets the channel to on-hook or
off-hook after the rings are detected. Using dx_wtring( ) is equivalent to using dx_setevtmsk( ),
dx_getevt( ), and dx_sethook( ) to wait for a ring. When dx_wtring( ) is called, the specified
channel’s event is set to DM_RINGS in dx_setevtmsk( ).
Note: Do not call this function for a digital T-1 TDM bus configuration that includes a D/240SC,
D/240SC-T1, or DTI/241SC board. Transparent signaling for TDM bus digital interface devices is
not supported.
An application can stop the dx_wtring( ) function from within a process or from another process,
as follows:
From within a process, a signal handler may issue a dx_stopch( ) with the handle for the
device waiting in dx_wtring( ). The mode parameter to dx_stopch( ) should be ORed with
EV_STOPWTRING flag to stop dx_wtring( ). The EV_STOPWTRING flag influences
dx_wtring( ) only. It does not affect the existing functionality of dx_stopch( ). Specifically, if
a different function besides dx_wtring( ) is in progress when dx_stopch( ) is called with
EV_STOPWTRING mode, that function will be stopped as usual. EV_STOPWTRING will
simply be ignored if dx_wtring( ) is not in progress.
From another process, dx_wtring( ) may be stopped using the inter-process event
communication mechanism. The event-sending process should open the device that has issued
dx_wtring( ) and call dx_sendevt( ) with its device handle to send the DE_STOPWTRING
event.
Using either of the two mechanisms above, dx_wtring( ) will fail and return a -1. lasterr will be
set to EDX_WTRINGSTOP.
Name: int dx_wtring(chdev, nrings, hstate, timeout)
Inputs: int chdev
valid channel device handle
int nrings
number of rings to wait for
int hstate
hook state to set after rings are detected
int timeout
timeout, in seconds
Returns: 0 if successful
-1 if failure
Includes: srllib.h
dxxxlib.h
Category: Configuration
Mode: synchronous
Platform: Springware