Intel 05-1832-002 IP Phone User Manual


 
322 Voice API for Windows Operating Systems Library Reference — November 2003
dx_playtoneEx( ) — play the cadenced tone defined by TN_GENCAD
/*
* Set up the Terminating Conditions.
* (Play until a digit is pressed or until time-out at 45 seconds.)
*/
tpt[0].tp_type = IO_CONT;
tpt[0].tp_termno = DX_MAXDTMF;
tpt[0].tp_length = 1;
tpt[0].tp_flags = TF_MAXDTMF;
tpt[1].tp_type = IO_EOT;
tpt[1].tp_termno = DX_MAXTIME; /* On DM3 boards, DX_MAXTIME not supported */
tpt[1].tp_length = 450;
tpt[1].tp_flags = TF_MAXTIME;
/*
* Build a custom cadence dial tone to indicate that a priority message is waiting.
* Signal cycle has 4 segments & repeats forever (cycles=255) until tpt termination:
* Note that cycles = 255 is supported on Springware but not on DM3 boards.
* 1) 350 + 440 Hz at -17dB ON for 125 * 10 msec and OFF for 10 *10 msec
* 2) 350 + 440 Hz at -17dB ON for 10 * 10 msec and OFF for 10 *10 msec
* 3) 350 + 440 Hz at -17dB ON for 10 * 10 msec and OFF for 10 *10 msec
* 4) 350 + 440 Hz at -17dB ON for 10 * 10 msec and OFF for 10 *10 msec
*/
tngencad.cycles = 255;
tngencad.numsegs = 4;
tngencad.offtime[0] = 10;
tngencad.offtime[1] = 10;
tngencad.offtime[2] = 10;
tngencad.offtime[3] = 10;
dx_bldtngen( &tngencad.tone[0], 350, 440, -17, -17, 125 );
dx_bldtngen( &tngencad.tone[1], 350, 440, -17, -17, 10 );
dx_bldtngen( &tngencad.tone[2], 350, 440, -17, -17, 10 );
dx_bldtngen( &tngencad.tone[3], 350, 440, -17, -17, 10 );
/*
* Play the custom dial tone.
*/
if (
dx_playtoneEx(
dxxxdev, &tngencad, tpt, EV_SYNC ) == -1 ) {
printf( "Unable to Play the Cadenced Tone\n" );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
/* Examine termination reason in bitmap.
/* If time-out caused termination, play reorder tone.
*/
if((term = ATDX_TERMMSK(dxxxdev)) == AT_FAILURE) {
/* Process error */
}
if(term & TM_MAXTIME) {
/*
* Play the standard Reorder Tone (fast busy) using the predefined tone
* from the set of standard call progress signals.
*/
if (
dx_playtoneEx(
dxxxdev, CP_REORDER, tpt, EV_SYNC ) == -1 ) {
printf( "Unable to Play the Cadenced Tone\n" );
printf( "Lasterror = %d Err Msg = %s\n",