|
VoiceResourceGetDigits Method (Int32, Int32, String, Int32, Boolean) |
Waits for a user input as Digit(s) specifying all settings for the
Voice Resource: Maximum Digits, Maximum Time, Termination Digit, Inter Digit Timeout and Clear Digit Buffer Flag.
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public TerminationCode GetDigits(
int maximumDigits,
int maximumTime,
string terminationDigits,
int interDigitTimeout,
bool clearDigitBuffer
)
Public Function GetDigits (
maximumDigits As Integer,
maximumTime As Integer,
terminationDigits As String,
interDigitTimeout As Integer,
clearDigitBuffer As Boolean
) As TerminationCode
public:
TerminationCode GetDigits(
int maximumDigits,
int maximumTime,
String^ terminationDigits,
int interDigitTimeout,
bool clearDigitBuffer
)
member GetDigits :
maximumDigits : int *
maximumTime : int *
terminationDigits : string *
interDigitTimeout : int *
clearDigitBuffer : bool -> TerminationCode
Parameters
- maximumDigits
- Type: SystemInt32
The maximum number of digits that will be accepted from the caller. For more information, and an alternative way to set this property, see
Maximum Digits Voice Resource Property.
- maximumTime
- Type: SystemInt32
The number of seconds to wait for the entire expected string of digits to be received. For more information, and an alternative way to set this property, see
Maximum Time Voice Resource Property.
- terminationDigits
- Type: SystemString
This digit, like a pound sign (#) would stop the code from waiting for more digits in a string. Note that using the "@" wildcard can be done here to denote any digit. This is
especially helpful when getting a variable length or long string of input from a caller. For more information, and an alternative way to set this property, see
Termination Digit Voice Resource Property.
- interDigitTimeout
- Type: SystemInt32
This is the number of seconds between digits in a string that will cause Get Response to terminate and consider the input of the string complete. For more information, and an alternative way to set this property, see
Inter-Digit Timeout Voice Resource Property.
- clearDigitBuffer
- Type: SystemBoolean
If set to true, digits in the buffer will be purged before the wait for Digits begins. Use this to clear any residual input you think might be in the buffer. For more information, and an alternative way to set this property, see
Clear Digit Buffer Resource Property.
Return Value
Type:
TerminationCode
A
Termination Code indicating how the wait ended. Typically, you will use this to determine what to do next.
Remarks Examples
The following sample code sets up a
Channel Resource,
Dials a Call, retrieves a
Voice Resource,
sets up some properties for a
Voice Resource object and executes a Get Digits with a max digits of 11, max time of 20 seconds, a pound sign termination, 3 second inter-digit timeout, and sets the clear digit buffer flag to true.
public void DialAndGetDigits()
{
TelephonyServer m_TelephonyServer = new TelephonyServer();
ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();
string phoneNumber = "2135551212";
m_ChannelResource.Dial(phoneNumber);
VoiceResource m_VoiceResource = m_ChannelResource.VoiceResource;
m_VoiceResource.ClearDigitBuffer = true;
m_VoiceResource.TerminationDigits = "@";
m_VoiceResource.Codec = Codec.MULAW_8Khz_8Bit;
m_VoiceResource.DataFormat = DataFormat.Raw;
TerminationCode tc = TerminationCode.Normal;
tc = m_VoiceResource.Play(@"Introduction.wav");
m_VoiceResource.ClearDigitBuffer = false;
tc = m_VoiceResource.Play(@"InputOptions.wav");
tc = m_VoiceResource.GetDigits(11, 20, "#", 3, true);
}
Public Sub DialAndGetDigits()
Dim m_TelephonyServer As New TelephonyServer()
Dim m_ChannelResource As ChannelResource = m_TelephonyServer.GetChannel()
Dim phoneNumber As String = "2135551212"
m_ChannelResource.Dial(phoneNumber)
Dim m_VoiceResource As VoiceResource = m_ChannelResource.VoiceResource
m_VoiceResource.ClearDigitBuffer = True
m_VoiceResource.TerminationDigits = "@"
m_VoiceResource.Codec = Codec.MULAW_8Khz_8Bit
m_VoiceResource.DataFormat = DataFormat.Raw
Dim tc As TerminationCode = TerminationCode.Normal
tc = m_VoiceResource.Play("Introduction.wav")
m_VoiceResource.ClearDigitBuffer = False
tc = m_VoiceResource.Play("InputOptions.wav")
tc = m_VoiceResource.GetDigits(11, 20, "#", 3, true)
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also