(Page 12 of 80 in this chapter)
adiFlushDigitQueue
Description
- Flushes the internal digit collection queue.
Prototype
- DWORD adiFlushDigitQueue( CTAHD ctahd )
- ctahd Context handle returned by adiOpenPort.
Return Values
Events
- None.
Details
- This function discards all digits in the AG Access internal digit collection queue. This function cannot be invoked while the application is actively collecting digits using adiCollectDigits.
Note: If any digits are queued in AG Access when a play or record voice operation is started, and the voice operation is to terminate on those specific touch-tones, 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.
- For example, if the application provides a play or record escape key (e.g., DTMF `*') and the remote party exercises it, the escape key remains in the AG Access digit queue after the voice operation terminates. The adiFlushDigitQueue or adiGetDigit function must be used to remove the escape key from the queue.
- The digit queue is automatically flushed when a call is released.
See Also
- adiGetDigit, adiCollectDigits, adiStopCollection, adiPeekDigit
Example
/* Play a message, ignoring dtmfs. */
int myPlayToCompletion( CTAHD ctahd, unsigned encoding,
void *buffer, unsigned bufsize )
{
ADI_PLAY_PARMS playparms;
ADI_EVENT event;
adiGetParms( ADI_COLLECT_PARMID, &playparms, sizeof playparms );
playparms.DTMFabort = 0x0;
adiPlayFromMemory( ctahd, encoding, buffer, bufsize, &playparms );
do
{
myGetEvent( &event ); /* see adiFetchAndProcess 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 be 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 12 of 80 in this chapter)
Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights
reserved.