Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 59
return the number of uncollected digits — ATDX_BUFDIGS( )
main()
{
int chdev;
long bufdigs;
DX_IOTT iott;
DV_TPT tpt[2];
/* Open the device using dx_open( ). Get channel device descriptor in
* chdev. */
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* process error */
}
/* set up DX_IOTT */
iott.io_type = IO_DEV|IO_EOT;
iott.io_bufp = 0;
iott.io_offset = 0;
iott.io_length = -1; /* play till end of file */
if((iott.io_fhandle = dx_fileopen("prompt.vox", O_RDONLY)) == -1) {
/* process error */
}
/* set up DV_TPT */
dx_clrtpt(tpt,2);
tpt[0].tp_type = IO_CONT;
tpt[0].tp_termno = DX_MAXDTMF; /* Maximum digits */
tpt[0].tp_length = 4; /* terminate on 4 digits */
tpt[0].tp_flags = TF_MAXDTMF; /* Use the default flags */
tpt[1].tp_type = IO_EOT;
tpt[1].tp_termno = DX_DIGMASK; /* Digit termination */
tpt[1].tp_length = DM_5; /* terminate on the digit "5" */
tpt[1].tp_flags = TF_DIGMASK; /* Use the default flags */
/* Play a voice file. Terminate on receiving 4 digits, the digit "5" or
* at end of file.*/
if (dx_play(chdev,&iott,tpt,EV_SYNC) == -1) {
/* process error */
}
/* Check # of digits collected and continue processing. */
if((bufdigs=ATDX_BUFDIGS(chdev))==AT_FAILURE) {
/* process error */
}
.
.
.
}
!
!!
! See Also
dx_getdig( )
dx_clrdigbuf( )