(Page 8 of 69 in this chapter) Version
Note: If any digits are queued in the ADI service when a play or record voice operation is started, and the voice operation is to terminate on those specific touchtones, the voice operation will terminate immediately. The adiFlushDigitQueue function may be used to force the remote caller to enter a digit, which prevents the caller from typing ahead.
/* Play a message, ignoring dtmfs. */
int myPlayToCompletion( CTAHD ctahd, unsigned encoding,
void *buffer, unsigned bufsize )
{
ADI_PLAY_PARMS playparms;
CTA_EVENT event;
adiGetParms( ADI_COLLECT_PARMID, &playparms, sizeof playparms );
playparms.DTMFabort = 0x0;
adiPlayFromMemory( ctahd, encoding, buffer, bufsize, &playparms );
do
{
myGetEvent( &event ); /* see ctaWaitEvent example */
} while( event.id != ADIEVN_PLAY_DONE );
if( event.value != CTA_REASON_FINISHED )
return MYFAILURE;
/* We've finished playing an uninteruptable message (no DTMF abort).
* but some DTMFs may have been pressed and are sitting in the digit
* collection queue. If we don't remove them, the queued digits
* will cause the next interruptible play to be aborted immediately.
*/
adiFlushDigitQueue( ctahd );
return SUCCESS;
}
(Page 8 of 69 in this chapter) Version