Dialogic 05-0867-005 Table Top Game User Manual


 
play a user-defined tone cc_PlayTone( )
181
* Play a Tone with its
* Frequency1 = 330, Frequency2 = 460
* amplitude at -10dB for both
* frequencies and duration of infinity
* This is a Panasonic Local Dial Tone.
*
*/
if (cc_PlayTone( devHdl, &ToneParm, &tpt, EV_SYNC ) == -1 ){
printf( "Unable to Play the Tone\n" );
printf( "Lasterror = %d Err Msg = %s\n",
cc_CauseValue( devHdl ), cc_ResultMsg( devHdl ) );
cc_close( devHdl);
exit( 1 );
}
/*
* Continue Processing
*.
*.
*.
*/
/*
* Close the opened Voice Channel Device
*/
if ( cc_Close( devHdl ) !=0){
printf( "Error closing devicd, errno= %d\n, errno );
}
/* Terminate the Program */
exit( 0 );
}
!
! !
!
Errors
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function
to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be
used to interpret the reason code. Error codes are defined in the files ccerr.h,
isdnerr.h, and isdncmd.h.
Error codes from the cc_PlayTone( ) function include the following:
Error Code Description
ERR_TONEINVALIDMSG Invalid message type
ERR_TONEBUSY Busy executing previous command
ERR_TONECP System error with CP
ERR_TONEDSP System error with DSP
ERR_TONEFREQ1 Invalid value specified in parameter freq 1
ERR_TONEFREQ2 Invalid value specified in parameter freq 2
ERR_TONEAMP1 Invalid value specified in parameter amp1
ERR_TONEAMP2 Invalid value specified in parameter amp2