Intel 05-1832-002 IP Phone User Manual


 
140 Voice API for Windows Operating Systems Library Reference — November 2003
dx_blddtcad( ) — define a user-defined dual frequency cadenced tone
!
!!
! Cautions
Only one user-defined tone per process can be defined at any time. dx_blddtcad( ) will
replace the previous user-defined tone definition.
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
None.
!
!!
! Example
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
#define TID_2 102
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 Dual Tone Frequency Tone of 950-1050 Hz
* and 475-525 Hz. On between 190-210 msecs and off
* 990-1010 msecs and a cadence of 3.
*/
if (
dx_blddtcad( TID_2, 1000, 50, 500, 25, 20, 1,
100, 1, 3 )
== -1 ) {
printf( "Unable to build a Dual Tone Cadence" );
printf( " Template\n");
}
ontime specifies the length of time for which the cadence is on (in 10 msec units)
ontdev specifies the allowable deviation for on time (in 10 msec units)
offtime specifies the length of time for which the cadence is off (in 10 msec units)
offtdev specifies the allowable deviation for off time (in 10 msec units)
repcnt specifies the number of repetitions for the cadence (that is, the number of times
that an on/off signal is repeated)
Parameter Description