
Description | Cautions | Example | Errors | See Also
Name: |
long ATDX_BUFDIGS(chdev) | |
Inputs: |
int chdev |
|
Returns: |
number of uncollected digits in the firmware buffer if successful | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
The ATDX_BUFDIGS( ) function returns the number of uncollected digits in the firmware buffer for channel chdev. This is the number of digits that have arrived since the last call to dx_getdig( ) or the last time the buffer was cleared using dx_clrdigbuf( ). The digit buffer contains a maximum of 31 digits and a null terminator.
The function parameter is defined as follows:
Parameter |
Description |
chdev |
specifies the valid channel device handle obtained when the channel was opened using dx_open( ). |
Digits that adjust speed and volume (see dx_setsvcond( )) will not be passed to the digit buffer.
#include <fcntl.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
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 */
}
.
.
.
}
This function will fail and return AT_FAILURE if an invalid channel device handle is specified in chdev.
Other digit functions:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation