Table of Contents Index NMS Glossary Previous Page Next Page (Page 8 of 69 in this chapter) Version


adiFlushDigitQueue

Description

Flushes the internal digit collection queue.

Prototype

DWORD adiFlushDigitQueue ( CTAHD ctahd )

ctahd CTA context handle returned by ctaCreateContext.

Return Values

Events

None.

Details

This function discards all digits in the ADI service 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 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.

For example, if the application provides a play or record escape key (for example, DTMF `*') and the remote party exercises it, the escape key remains in the ADI service 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;
    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;
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 8 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.