Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 379
enable detection of call status transition (CST) events — dx_setevtmsk( )
/* Set event mask to collect digits */
if (dx_setevtmsk(chdev, DM_DIGITS) == -1) {
To disable DM_DIGITS (turn off the digits flag and stop queuing digits):
dx_setevtmsk(
DM_DIGOFF
);
dx_clrdigbuf(chdev); /*Clear out queue*/
The following outlines the synchronous or asynchronous handling of CST events:
!
!!
! Cautions
If you call this function on a busy device, and specify DM_DIGITS as the mask argument, the
function will fail.
!
!!
! Errors
This function will fail and return -1 if the channel device handle is invalid or if any of the masks set
for that device are invalid.
If the function returns -1, use the Standard Runtime Library (SRL) Standard Attribute function
ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive
error message. One of the following error codes may be returned:
EDX_BADPARM
Invalid parameter
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example 1
This example illustrates how to use dx_setevtmsk( ) to wait for ring events in a synchronous
application.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev;
DX_EBLK eblk;
.
.
Synchronous Application Asynchronous Application
Call dx_setevtmsk( ) to enable CST events. Call dx_setevtmsk( ) to enable CST events.
Call dx_getevt( ) to wait for CST events.
Events are returned to the DX_EBLK
structure.
Use Standard Runtime Library (SRL) to
asynchronously wait for TDX_CST events.
Use sr_getevtdatap( ) to retrieve DX_CST
structure.