Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 127
add a user-defined tone — dx_addtone( )
/*
* 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 Template\n" );
}
/*
* Bind the Tone to the Channel
*/
if ( dx_addtone( dxxxdev, 'A', DG_USER1 ) == -1 ) {
printf( "Unable to Bind the Tone %d\n", TID_2 );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ));
dx_close( dxxxdev );
exit( 1 );
}
/*
* Describe a Simple Single Tone Frequency Tone of
* 950-1050 Hz using trailing edge detection.
*/
if ( dx_bldst( TID_3, 1000, 50, TN_TRAILING ) == -1 ) {
printf( "Unable to build a Single Tone Template\n" );
}
/*
* Bind the Tone to the Channel
*/
if ( dx_addtone( dxxxdev, 'D', DG_USER2 ) == -1 ) {
printf( "Unable to Bind the Tone %d\n", TID_3 );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
* Describe a Single Tone Frequency Tone of 950-1050 Hz.
* On between 190-210 msecs and off 990-1010 msecs and
* a cadence of 3.
*/
if ( dx_bldstcad( TID_4, 1000, 50, 20, 1, 100, 1, 3 ) == -1 ) {
printf("Unable to build a Single Tone Cadence Template\n");
}
/*
* Bind the Tone to the Channel
*/
if ( dx_addtone( dxxxdev, NULL, 0 ) == -1 ) {
printf( "Unable to Bind the Tone %d\n", TID_4 );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
* Continue Processing
* .
* .
* .
*/