Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 469
play R2/MF backward signal tone — r2_playbsig( )
/*
* Continue Processing
* .
* .
* .
*
* Detect an incoming call using dx_wtring()
*
* Enable the detection of all forward signals using
* dx_enbtone(). In this example, only the first
* forward signal will be enabled.
*/
if (dx_enbtone( dxxxdev, SIGI_1, DM_TONEON | DM_TONEOFF ) == -1 ) {
printf( "Unable to Enable Detection of Tone %d\n", SIGI_1 );
printf( "Lasterror = %d Err Msg = %s\n",
ATDV_LASTERR( dxxxdev ), ATDV_ERRMSGP( dxxxdev ) );
dx_close( dxxxdev );
exit( 1 );
}
/*
* Now wait for the TDX_CST event and event type,
* DE_TONEON. The data part contains the ToneId of
* the forward signal detected. Based on the forward
* signal, determine the backward signal to generate.
*
* In this example, we will be generating the Group A
* backward signal A-1 (send next digit) assuming
* forward signal received is SIGI_1.
*/
if (
r2_playbsig( dxxxdev, SIGA_1, SIGI_1, EV_SYNC )
== -1 ) {
printf( "Unable to generate the backward signals\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
r2_creatfsig( )
dx_blddt( )
dx_playtone( )
R2/MF Signaling in Voice API Programming Guide