
Description | Cautions | Example | Errors
Name: |
long ATDX_TRCOUNT(chdev) | |
Inputs: |
int chdev |
|
Returns: |
last play/record transfer count if successful | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
The ATDX_TRCOUNT( ) function returns the byte count for the last I/O transfer during play or record on the channel chdev.
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( ). |
None.
#include <stdio.h>
#include <fcntl.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int chdev;
long trcount;
DX_IOTT iott;
DV_TPT tpt[2];
/* Open the channel device */
if ((chdev = dx_open("dxxxB1C1",NULL)) == -1) {
/* Process error */
}
/* Record a voice file. Terminate on receiving a digit, 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 = 0L;
iott.io_length = 50000L;
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,2);
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_EOT;
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 */
/* Now record to the file */
if (dx_rec(chdev,&iott,tpt,EV_SYNC) == -1) {
/* process error */
}
/* Examine transfer count */
if((trcount = ATDX_TRCOUNT(chdev)) == AT_FAILURE) {
/* Process error */
}
printf("%ld bytes recorded\n", trcount);
.
.
}
This function will fail and return AT_FAILURE if an invalid channel device handle is specified in chdev.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation