Intel 05-1832-002 IP Phone User Manual


 
352 Voice API for Windows Operating Systems Library Reference — November 2003
dx_recvox( ) — record voice data to a single VOX file
other words, you must issue a dx_listen( ) function call on the device handle before calling any
voice streaming function for that device handle. Furthermore, the dx_listen( ) function must
be called within the same process as the voice streaming functions. The actual recording
operation will start only after the voice channel is listening to the proper external time slot.
When playing or recording VOX files, the data format is specified in DX_XPB rather than
through the mode parameter of dx_recvox( ).
!
!!
! Errors
If this function returns -1 to indicate failure, one of the following reasons will be contained by
ATDV_LASTERR( ):
EDX_BADIOTT
Invalid DX_IOTT setting
EDX_BUSY
Channel is busy
EDX_SH_BADCMD
Unsupported command or VOX file format
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value.
EDX_XPBPARM
Invalid DX_XPB setting
!
!!
! Example
#include "srllib.h"
#include "dxxxlib.h"
main()
{
int chdev; /* channel descriptor */
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;
/* Wait forever for phone to ring and go offhook */
if (dx_wtring(chdev,1,DX_OFFHOOK,-1) == -1) {
printf("Error waiting for ring - %s\n", ATDV_LASTERR(chdev));
exit(3);
}