(Page 17 of 80 in this chapter)


adiGetDigit

Description

Retrieves a digit from the front of the AG Access internal digit queue.

Prototype

DWORD adiGetDigit( CTAHD ctahd,
char *digit )

ctahd Context handle returned by adiOpenPort.

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','B','C' and `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 AG Access 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' );
}



(Page 17 of 80 in this chapter)


Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.