
Description | Cautions | Example | Errors | See Also
Name: |
int dx_wtring(chdev,nrings,hstate,timeout) | |
Inputs: |
int chdev |
|
int nrings |
| |
int hstate |
| |
int timeout |
| |
Returns: |
0 if successful | |
-1 if failure | ||
Includes: |
srllib.h | |
dxxxlib.h | ||
Category: |
Configuration | |
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.
The function parameters are defined as follows:
Parameter |
Description | |
chdev |
specifies the valid channel device handle obtained when the channel was opened using dx_open( ). | |
nrings |
specifies the number of rings to wait for before setting the hook state. | |
hstate |
sets the hookstate of the channel after the number of rings specified in nrings are detected. hstate can have either of the following values: | |
|
channel remains on-hook when nrings number of rings are detected | ||
|
channel goes off-hook when nrings number of rings are detected | ||
timeout |
specifies the maximum length of time in tenths of seconds to wait for a ring. timeout can have one of the following values: | |
|
# of seconds: |
maximum length of time to wait for a ring. | |
|
-1: |
dx_wtring( ) waits forever and never times out. | |
|
0: |
dx_wtring( ) returns -1 immediately if a ring event does not already exist. | |
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev; /* channel descriptor */
.
.
/* Open Channel */
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
/* Wait for two rings on this channel - no timeout */
if (dx_wtring(chdev,2,DX_OFFHOOK,-1) == -1) {
/* process error */
}
.
.
}
If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:
|
EDX_BADPARM |
|
EDX_SYSTEM |
|
EDX_TIMEOUT |
|
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation