Hope this help!
COLLECT DIGITS
Collect digits from the caller through voice ports. Script execution is suspended until the digit collection is complete. If the call is queued before the COLLECT DIGITS command is executed, digit collection is interrupted when an agent becomes available. An enhanced GIVE IVR command replaces the COLLECT DIGITS command in SIP-enabled contact centers. For information about the GIVE IVR command in SIP-enabled contact centers,
see Contact processing for SIP on page 365.
The maximum number of digits that can be collected is 16. You must also define a DN type call variable in which to store the digits.
Important: This command is used only within an OPEN VOICE SESSION and END VOICE SESSION section.
Syntax
COLLECT <max_num_of_digits> DIGITS INTO <call_digit_var>
{NO TYPE AHEAD}
{INTER DIGIT TIMER <timer>}
{WITH TERMINATING CHARACTER <terminating_char>}
Parameters
<max_num_of_digits> The maximum number of digits, up to 16, that you want to collect. The script continues automatically when the specified number of digits is collected. The terminating character, if you use it, counts as a digit. For example, if you collect 8 digits from the call, you must specify the maximum number of digits as 9.
<call_digit_var> The call variable in which you want to store the collected di<timer> The maximum time, in seconds, that you want the script to wait between each digit collected. This variable must be a DN type call variable.
<terminating_char> The number (from 0–9) or symbol (* or #) that, when collected, terminates the digit collection before the maximum number of digits is reached.
The symbols asterisk (*) and pound (#) are terminating characters only. They are not used for any other purpose.