Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 437
generate an outbound wink — dx_wink( )
a TDX_WINK termination event to indicate completion. Use the Standard Runtime Library (SRL)
Event Management functions to handle the termination event.
For more information on wink signaling, such as how to set delay prior to wink, see the Voice API
Programming Guide.
!
!!
! Cautions
Make sure the channel is on-hook when dx_wink( ) is called.
!
!!
! Errors
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_wink( ) in synchronous mode.
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev;
DV_TPT tpt;
DV_DIGIT digitp;
char buffer[8];
/* open a channel with chdev as descriptor */
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
/* set hookstate to on-hook and wink */
if (dx_sethook(chdev,DX_ONHOOK,EV_SYNC) == -1) {
/* process error */
}
if (
dx_wink(chdev,EV_SYNC) ==
-1) {
/* error winking channel */
}
dx_clrtpt(&tpt,1);
/* set up DV_TPT */
tpt.tp_type = IO_EOT; /* only entry in the table */
tpt.tp_termno = DX_MAXDTMF; /* Maximum digits */
tpt.tp_length = 1; /* terminate on the first digit */
tpt.tp_flags = TF_MAXDTMF; /* Use the default flags */