Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 113
return the reason for the last I/O function termination — ATDX_TERMMSK( )
On DM3 boards, when both DX_MAXDTMF and DX_DIGMASK termination conditions are
specified in the DV_TPT structure, and both conditions are satisfied, the
ATDX_TERMMSK( ) function will return the TM_MAXDTMF termination event only.
For example, with a DX_MAXDTMF condition of 2 digits maximum and a DX_DIGMASK
condition of digit “1”, if the digit string “21” is received, both conditions are satisfied but only
TM_MAXDTMF will be reported by ATDX_TERMMSK( ).
This behavior differs from Springware products, where both TM_MAXDTMF and
TM_DIGIT will be returned when both DX_MAXDTMF and DX_DIGMASK termination
conditions are specified in the DV_TPT structure and both are satisfied by the user input.
!
!!
! Errors
This function will fail and return AT_FAILURE if an invalid channel device handle is specified in
chdev.
!
!!
! Example
#include <stdio.h>
#include <fcntl.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev;
long term;
DX_IOTT iott;
DV_TPT tpt[4];
/* Open the channel device */
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* Process error */
}
/* Record a voice file. Terminate on receiving a digit, silence, loop
* current drop, max time, or reaching a byte count of 50000 bytes.
*/
/* set up DX_IOTT */
iott.io_type = IO_DEV|IO_EOT;
iott.io_bufp = 0;
iott.io_offset = 0;
iott.io_length = 50000;
if((iott.io_fhandle = dx_fileopen("file.vox", O_RDWR)) == -1) {
/* process error */
}
/* set up DV_TPTs for the required terminating conditions */
dx_clrtpt(tpt,4);
tpt[0].tp_type = IO_CONT;
tpt[0].tp_termno = DX_MAXDTMF; /* Maximum digits */
tpt[0].tp_length = 1; * terminate on the first digit */
tpt[0].tp_flags = TF_MAXDTMF; /* Use the default flags */
tpt[1].tp_type = IO_CONT;
tpt[1].tp_termno = DX_MAXTIME; /* Maximum time */
tpt[1].tp_length = 100; /* terminate after 10 secs */
tpt[1].tp_flags = TF_MAXTIME; /* Use the default flags */
tpt[2].tp_type = IO_CONT;