Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 349
record voice data to multiple destinations — dx_reciottdata( )
In synchronous mode, if this function returns -1 to indicate failure, one of the following error codes
will be returned by ATDV_LASTERR( ):
EDX_BADIOTT
Invalid DX_IOTT setting
EDX_BADWAVFILE
Invalid WAVE file
EDX_BUSY
Channel is busy
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
EDX_XPBPARM
Invalid DX_XPB setting
EDX_SH_BADCMD
Unsupported command or WAVE file format
!
!!
! Example
#include <srllib.h>
#include <dxxxlib.h>
main()
{
int chdev; /* channel descriptor */
int fd; /* file descriptor for file to be played */
DX_IOTT iott; /* I/O transfer table */
DV_TPT tpt; /* termination parameter table */
DX_XPB xpb; /* I/O transfer parameter block */
.
.
.
/* Open channel */
if ((chdev = dx_open("dxxxB1C1",0)) == -1) {
printf("Cannot open channel\n");
/* Perform system error processing */
exit(1);
}
/* Set to terminate play on 1 digit */
tpt.tp_type = IO_EOT;
tpt.tp_termno = DX_MAXDTMF;
tpt.tp_length = 1;
tpt.tp_flags = TF_MAXDTMF;
/* Open file */
if ((fd = dx_fileopen("MESSAGE.VOX",O_RDWR|O_BINARY)) == -1) {
printf("File open error\n");
exit(2);
}
/* Set up DX_IOTT */
iott.io_fhandle = fd;
iott.io_bufp = 0;
iott.io_offset = 0;
iott.io_length = -1;
iott.io_type = IO_DEV | IO_EOT;