
Description | Cautions | Example | Errors | See Also
Name: |
int dx_deltones(chdev) | |
Inputs: |
int chdev |
|
Returns: |
0 |
|
-1 |
| |
Includes: |
srllib.h | |
Category: |
Global Tone Detection | |
The dx_deltones( ) function deletes all user-defined tones previously added to a channel with dx_addtone( ). If no user-defined tones were previously enabled for this channel, this function has no effect.
Parameter |
Description |
chdev |
specifies the valid Dialogic channel device handle obtained when the channel was opened using dx_open( ). |
When using this function in a multi-threaded application, use critical sections or a semaphore around the function call to ensure a thread-safe application. Failure to do so will result in "Bad Tone Template ID" errors.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int dxxxdev;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", NULL) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Delete all Tone Templates
*/
if ( dx_deltones( dxxxdev ) == -1 ) {
printf( "Unable to Delete all the Tone Templates\n" );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
* Continue Processing
* .
* .
* .
*/
/*
* Close the opened Voice Channel Device
*/
if ( dx_close( dxxxdev ) != 0 ) {
perror( "close" );
}
/* Terminate the Program */
exit( 0 );
}
If the function returns -1 to indicate failure, call ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to return one of the following errors:
|
EDX_BADPARM |
|
EDX_BADPROD |
|
EDX_SYSTEM |
|
Adding and Enabling User-defined Tones:
Building Tones:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation