Click or drag to resize

VoiceResourcePlayTouchTones Method

Plays DTMF or touch tones corresponding to the string specified.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public TerminationCode PlayTouchTones(
	string touchTones
)

Parameters

touchTones
Type: SystemString
The string of numbers you wish to be played as DTMF or Touch Tones.

Return Value

Type: TerminationCode
A Termination Code indicating how the play ended. Typically, you will use this to determine what to do next.
Remarks
Typical Use: Dialing Into An External IVR or Call Center

Typically, your application will be gathering DTMF digits using the Get Response Method, However, you may want to have your application Dial into another IVR system, call center or PBX. If this target system requires user input to get to a specific extension or function, you will use this method to simulate the digit presses to automatically navigate the target system.

Examples
The following sample code sets up a Channel Resource, Dials a Call, retrieves a Voice Resource, and then waits a few seconds and dials '5309', an imaginary extension in a remote PBX.
public void DialOutAndDialRemoteExtension()
{
    // To get a channel, you must first get a link to a Telephony Server.  You may need to pass a username password here.
    TelephonyServer m_TelephonyServer = new TelephonyServer();

    // Get your channel resource from the server
    ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();

    // Example 1: Dial an oubound call
    string phoneNumber = "2135551212";
    m_ChannelResource.Dial(phoneNumber);

    // Get the voice resource and store in a variable for local use
    VoiceResource m_VoiceResource = m_ChannelResource.VoiceResource;

    // Wait 1 second for pickup by pbx
    Thread.Sleep(1000);

    //Play remote extension on pbx
    m_VoiceResource.PlayTouchTones("5309");

    // Wait 5 seconds for pickup on extension
    Thread.Sleep(5000);

    // Set the codec to the desired audio format - This is our recommeded for all audio!
    m_VoiceResource.Codec = Codec.MULAW_8Khz_8Bit;

    // First, play an audio file to say hello to the caller
    m_VoiceResource.Play(@"C:\Audio\HelloDeskPhone.wav");

    // Take your code from here ... 
}
See Also