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


adiGetDigit

Description

Retrieves a digit from the front of the ADI service internal digit queue.

Prototype

DWORD adiGetDigit ( CTAHD ctahd,
char *digit )

ctahd CTA context handle returned by ctaCreateContext.

digit Pointer to a character to store the digit extracted from the digit queue (valid digit values are the DTMF characters 0...9, # (pound) and * (star), as well as A...D. If the digit queue is empty, digit is filled with 0 (NULL character)).

Return Values

Events

None.

Details

This function retrieves a single DTMF digit character from the front of the ADI service internal digit queue. The oldest digit is removed from the queue and copied to the address pointed to by digit. If the digit queue is empty, zero is written to digit.

This function cannot be invoked if the application is actively collecting digits using the adiCollectDigits function.

To read the first digit without removing it from the collection queue, use adiPeekDigit.

Note: If there is a digit in the internal digit queue that is configured in the abort_mask of a play or record operation to terminate the operation, then the operation terminates immediately. adiGetDigit may be used to remove the digit from the queue.

See Also

adiFlushDigitQueue, adiCollectDigits, adiStopCollection, adiPeekDigit

Example


/* Remove and display digits in the digit queue */
void getandshowdigits( CTAHD ctahd )
{
    for (;;)
    {
        char digit;

        adiGetDigit( ctahd, &digit );
        if( digit == '\0' )
            break;
        putchar( digit );
    }
    putchar( '\n' );
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 13 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.