Click or drag to resize
TapiCallGatherDigits Method
Gathers one or more DTMF digits on the call.

Namespace: Traysoft.AddTapi
Assembly: Traysoft.AddTapi (in Traysoft.AddTapi.dll) Version: 6.0.0.1110
Syntax
public string GatherDigits(
	int numDigits,
	string terminationDigits,
	int firstDigitTimeoutSeconds,
	int interDigitTimeoutSeconds
)

Parameters

numDigits
Type: SystemInt32
The number of digits to be collected.
terminationDigits
Type: SystemString
A string of termination digits as text characters. If one of the digits in the string is detected, that termination digit is appended to the buffer, digit collection is terminated, and the buffer is returned to the application.
firstDigitTimeoutSeconds
Type: SystemInt32
Time duration in seconds in which the first digit is expected. Negative value means that the timeout should start after playback initiated by Play(String) or Speak(String) is completed. If the first digit is not received in this timeframe, digit collection is terminated and null reference (Nothing in Visual Basic) is returned to the application.
interDigitTimeoutSeconds
Type: SystemInt32
Maximum time duration in seconds between consecutive digits. If no digit is received in this timeframe, digit collection is terminated and the digits collected up to this point are returned to the application.

Return Value

Type: String
A string that contains gathered digits. The returned string contains detected termination digit, if any. If the first digit was not received within firstDigitTimeoutSeconds seconds, this method returns null reference (Nothing in Visual Basic).
Exceptions
ExceptionCondition
TapiDisconnectExceptionThe call has been disconnected while waiting for a digit.
Remarks
This method gathers DTMF digits (buttons) pressed by remote party on a touch-tone phone. The application can use this method to gather a fixed number of digits or to gather a variable number of digits followed by a termination digit. For example, if the application expects the caller to enter an 8-digit account number, set numDigits parameter to 8 and terminationDigits to null (Nothing in Visual Basic). In this case GatherDigits will terminate when the caller enters exactly 8 digits (or when one of the timeouts expires). If the application expects a pin code that has 4 to 6 digits followed by the # key, set numDigits to 7 (6 digits for a pin code plus # key) and terminationDigits to "#". In this case GatherDigits will terminate when the caller presses the # key or enters 7 digits (or when one of the timeouts expires). The application can check returned string to determine how many digits where entered. Please note that GatherDigits ignores the digits received before the application called this method.
See Also