Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 289
record voice data from two TDM bus time slots — dx_mreciottdata( )
EDX_BUSY
Busy executing I/O function
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example
#include <windows.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <srllib.h>
#include <dxxxlib.h>
#define MAXLEN 10000
main()
{
int devh1, devh2, devh3;
short fd;
DV_TPT tpt;
DX_IOTT iott[2];
DX_XPB xpb;
SC_TSINFO tsinfo;
long scts;
long tslots[32];
char basebufp[MAXLEN];
/* open two voice channels */
if ((devh1 = dx_open("dxxxB1C1", NULL)) == -1) {
printf("Could not open dxxxB1C1\n");
exit (1);
}
if ((devh2 = dx_open("dxxxB1C2", NULL)) == -1) {
printf("Could not open dxxxB1C2\n");
exit (1);
}
if ((devh3 = dx_open("dxxxB1C3", NULL)) == -1) {
printf("Could not open dxxxB1C2\n");
exit (1);
}
if ((fd = dx_fileopen("file.vox", O_CREAT | O_RDWR | O_BINARY)) == -1){
printf("File open error\n");
exit (1);
}
/*
* Get channels' external time slots
* and fill in tslots[] array
*/
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &scts;
if (dx_getxmitslot (devh1, &tsinfo) == -1 )
{ /* Handle error */ }
tslots[0] = scts;
if (dx_getxmitslot (devh2, &tsinfo) == -1 )
{ /* Handle error */ }
tslots[1] = scts;