Intel 05-1832-002 IP Phone User Manual


 
318 Voice API for Windows Operating Systems Library Reference — November 2003
dx_playtone( ) — play tone defined by TN_GEN structure
tpt[0].tp_flags = TF_TONE;
tpt[0].tp_data = DX_TONEON;
tpt[1].tp_type = IO_CONT;
tpt[1].tp_termno = DX_TONE;
tpt[1].tp_length = TID_1;
tpt[1].tp_flags = TF_TONE;
tpt[1].tp_data = DX_TONEOFF;
tpt[2].tp_type = IO_EOT;
tpt[2].tp_termno = DX_MAXTIME; /* On DM3 boards, DX_MAXTIME not supported */
tpt[2].tp_length = 6000;
tpt[2].tp_flags = TF_MAXTIME;
if (
dx_playtone( dxxxdev, &tngen, tpt, EV_SYNC )
== -1 ){
printf( "Unable to Play the Tone\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 );
}
!
!!
! See Also
dx_bldtngen( )
TN_GEN data structure
global tone generation topic in Voice API Programming Guide
event management functions in Standard Runtime Library API Library Reference
DV_TPT data structure (to specify a termination condition)
ATDX_TERMMSK( )