Intel 05-1832-002 IP Phone User Manual


 
308 Voice API for Windows Operating Systems Library Reference — November 2003
dx_playf( ) — synchronously play voice data
!
!!
! Errors
If the function returns -1, use the Standard Runtime Library (SRL) Standard Attribute function
ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive
error message. One of the following error codes may be returned:
EDX_BADPARM
Invalid parameter
EDX_BADIOTT
Invalid DX_IOTT entry
EDX_BADTPT
Invalid DX_TPT entry
EDX_BUSY
Busy executing I/O function
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Source Code
/***************************************************************************
* NAME: int dx_playf(devd,filep,tptp,mode)
* DESCRIPTION: This function opens and plays a
* named file.
* INPUTS: devd - channel descriptor
* tptp - pointer to the termination control block
* filep - pointer to file name
* OUTPUTS: Data is played.
* RETURNS: 0 - success -1 - failure
* CALLS: open() dx_play() close()
* CAUTIONS: none.
*************************************************************************/
int dx_playf(devd,filep,tptp,mode)
int devd;
char *filep;
DV_TPT *tptp;
USHORT mode;
{
DX_IOTT iott;
int rval;
/*
* If Async then return Error
* Reason: IOTT's must be in scope for the duration of the play
*/
if ( mode & EV_ASYNC ) {
return( -1 );
}
/* Open the File */
if ((iott.io_fhandle = open(filep,O_RDONLY)) == -1) {
return -1;
}
/* Use dx_play() to do the Play */
iott.io_type = IO_EOT | IO_DEV;
iott.io_offset = (unsigned long)0;
iott.io_length = -1;