Voicetronix Programming Guide
<<< Previous |  | Next >>>

# Get Digits Functions

The VPBAPI supports the collection of digits from a channel. This includes an asynchronous and synchronous version. The functions initiate collection of the digits from the channel and place them in a user digit buffer:

`vpb_get_digits_sync()`
`vpb_get_digits_async()`

The conditions of termination for the functions may be configured via the `VPB_DIGITS` structure. In the asynchronous version, the condition of termination is passed to the data field of the `VPB_EVENT` structure once the collection of digits from the channel to the user digit buffer has terminated.

The synchronous version returns the appropriate termination code (see `vpbapi.h`) once the function has ended. A flush function is also included to reset the user digit buffer. `vpb_flush_digits()` Ensure this is used to clear the user digit buffer of any digits from previous actions on the channel before executing any of the get digits functions.

## Get Digit Termination codes

Termination code | Description
--- | ---
VPB_DIGIT_TERM | Termination due to a user-defined termination-digit being pressed
VPB_DIGIT_MAX | Termination due to having reached the maximum number of digits
VPB_DIGIT_TIME_OUT | Termination due to the time limit to collect digits having expired
VPB_DIGIT_INTER_DIGIT_TIME_OUT | Termination due to the inter-digit time limit having expired

<<< Previous | Home | Next >>>
WAVE File and AU File Functions |  | Call Progress Functions