Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 137
define a user-defined dual-frequency tone — dx_blddt( )
!
!!
! Cautions
Only one tone per process can be defined at any time. Ensure that dx_blddt( ) is called for
each dx_addtone( ). The tone is not created until dx_addtone( ) is called, and a second
consecutive call to dx_blddt( ) will replace the previous tone definition for the channel. If you
call dx_addtone( ) without calling dx_blddt( ) an error will occur.
Do not use tone IDs 261, 262 and 263; they are reserved for library use.
If you are using R2/MF tone detection, reserve the use of tone IDs 101 to 115 for the R2/MF
tones. See r2_creatfsig( ) for further information.
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.
!
!!
! Errors
For a list of error codes, see the Error Codes chapter.
!
!!
! Example
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
#define TID_1 101
main()
{
int dxxxdev;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", 0 ) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}
/*
* Describe a Simple Dual Tone Frequency Tone of 950-
* 1050 Hz and 475-525 Hz using leading edge detection.
*/
if (
dx_blddt( TID_1, 1000, 50, 500, 25, TN_LEADING )
== -1 ) {
printf( "Unable to build a Dual Tone Template\n" );
}
/*
* Continue Processing
* .
* .
* .
*/
/*
* Close the opened Voice Channel Device
*/
if ( dx_close( dxxxdev ) != 0 ) {
perror( "close" );
}