Click or drag to resize

ChannelResourceDialResult Property

Gets the Dial Result of the last call based on the Call Progress Mode setting.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public DialResult DialResult { get; }

Property Value

Type: DialResult
Remarks
This property is typically used to switch and run different scripts based on the result of the last call. For example, if a human is detected, you may want to do something different than if a machine has answered. You will also want to handle busies, no answer, etc. make sure to think about and set the Call Progress Mode before dialing a call.

Call Progress Mode: Speed of Return vs Dial Result

The way you set the Call Progress Mode property will directly affect how quickly your dial returns and how many possible outcomes are available. For example, if you set this to DialOnly, your code will not get a "Human Detected" Dial Result. Make sure you understand which mode to use for the balance between speed of return and the switches you need in your application based on Dial Result. Before deciding carefully evaluate the Call Progress Modes and Dial Results.

Examples
The samples below shows two of the three Call Progress Modes. The first method sets to analyze call which will get all possible Dial Results. The second method only gets Connected or not connected.
public void DialOutAnalyze()
{
  // 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();

  // Put the phone number in a variable
  string m_PhoneNumber = "2135551212";

  // Set the call progress for the maximum number of possible dial results
  m_ChannelResource.CallProgress = CallProgress.AnalyzeCall;

  // Dial the call
  m_ChannelResource.Dial(m_PhoneNumber);

  // Get the dial result
  DialResult dialResult = m_ChannelResource.DialResult;

  // Branch based on what happens to the call
  switch (dialResult)
  {
    case DialResult.HumanDetected:
        // Put your script for connecting to a live person here
        break;
    case DialResult.MachineDetected:
        // Put your script for connecting to a machine or voicemail here
        break;
    case DialResult.Busy:
      // Put code to move on or do what you want with a Busy here
      break;
    default:
      // Handle all other dial results
      break;
  }
}

public void DialOutJustConnect()
{
  // 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();

  // Put the phone number in a variable
  string m_PhoneNumber = "2135551212";

  // Set the call progress for just connected, not connected
  m_ChannelResource.CallProgress = CallProgress.WaitForConnect;

  // Dial the call and put the result in a variable
  m_ChannelResource.Dial(m_PhoneNumber);

  // Get the dial result
    DialResult dialResult = m_ChannelResource.DialResult;

  // Branch based on what happens to the call
  switch (dialResult)
    {
      case DialResult.Connected:
      // Put your script for a connection here
      break;
    default:
      // Handle no connection here
      break;
  }
}
See Also