|
VoiceResourceGetDigits Method |
Waits for a user input as Digit(s) using all current settings for the
Voice Resource, and therefore has no parameters.
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public TerminationCode GetDigits()
Public Function GetDigits As TerminationCode
public:
TerminationCode GetDigits()
member GetDigits : unit -> TerminationCode
Return Value
Type:
TerminationCode
A
Termination Code indicating how the wait ended. Typically, you will use this to determine what to do next.
Remarks
This method does not set any of the required
Voice Resource properties for how long to wait, what digits to expect, etc. Whatever has been set in the VR properties will be used to determine the behavior of your
waiting for Digits using this overload. In the sample code below, these properties are specifically set before calling Get Digits.
Voice Resource Properties and Overloads
This method has three additional overloads allowing you to set specific
Voice Resource properties to control behavior. Before choosing, you will want to review the
Three Parameter Get Digits Overload, the
Four Parameter Get Digits Overload
and the
Five Parameter Get Digits Overload.
If you choose to use this method and not one of the overloads, keep in mind that you have set the Voice Resource properties before calling Get Digits. The relevant properties you need to consider are:
- Maximum Digits Property - The maximum number of digits that will be accepted from the caller.
- Maximum Time Property -
The number of seconds to wait for the entire expected string of digits to be received.
- Termination Digit Property -
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.
- Inter-Digit Timeout Property - This is the number of seconds between digits in a string that will cause Get Digits to terminate and consider the input of the string complete.
- Clear Digit Buffer Flag -
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.
Get Digits vs Get Response: Speech Recognition
This method will only capture
DTMF Digits. It has been replces by
Get Response and its respective overloads
which support digits and
Speech Recognition.
This Method is Obsolete. Tip: Use Get Response
It is advised to use
Get Response instead of this method.
Examples
The following sample code sets up a
Channel Resource,
Dials a Call, retrieves a
Voice Resource,
sets up the common properties for a
Voice Resource object and executes a Get Digits at the end.
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.MaximumDigits = 11;
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");
m_VoiceResource.MaximumTime = 20;
m_VoiceResource.TerminationDigits = "#";
tc = m_VoiceResource.GetDigits();
}
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.MaximumDigits = 11
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")
m_VoiceResource.MaximumTime = 20
m_VoiceResource.TerminationDigits = "#"
tc = m_VoiceResource.GetDigits()
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