AddTapi.NET Developer's Manual
GatherDigits Method (numDigits, terminationDigits, firstDigitTimeoutSeconds, interDigitTimeoutSeconds)
NamespacesTraysoft.AddTapiTapiCallGatherDigits(Int32, String, Int32, Int32)
Gathers one or more DTMF digits on the call.
Declaration Syntax
C#Visual BasicVisual C++
public string GatherDigits(
	int numDigits,
	string terminationDigits,
	int firstDigitTimeoutSeconds,
	int interDigitTimeoutSeconds
)
Public Function GatherDigits ( _
	numDigits As Integer, _
	terminationDigits As String, _
	firstDigitTimeoutSeconds As Integer, _
	interDigitTimeoutSeconds As Integer _
) As String
public:
String^ GatherDigits(
	int numDigits, 
	String^ terminationDigits, 
	int firstDigitTimeoutSeconds, 
	int interDigitTimeoutSeconds
)
Parameters
numDigits (Int32)
The number of digits to be collected.
terminationDigits (String)
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 (Int32)
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 (Int32)
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
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).
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.
Exceptions
ExceptionCondition
TapiDisconnectExceptionThe call has been disconnected while waiting for a digit.
See Also

Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)