Click or drag to resize

ChannelResourceDial Method

Dials the phone number or destination specified in the phonenumber parameter.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.4.0
Syntax
public DialResult Dial(
	string phonenumber
)

Parameters

phonenumber
Type: SystemString
This is the number to dial. It should be formatted as a phone number string without any special characters, i.e. "2135551212". Alternately, when using SIP, you may pass an IP address or SIP address, i.e. "john@127.0.0.1".

Return Value

Type: DialResult
The result of the dial is passed back as a Dial Result. Typically, you will want to do a switch or another kind of branch based on the different dial result in your code.
Remarks
Format your Phone Number

You will want to remove all dashes, parentheses and all other special characters before passing the phone number to this method.

SIP Addressing

When using SIP, you may substitute the phone number with a SIP address. A SIP URI or specific call destination has many aspects, for details you can read about the SIP URI formats here. For example, you may specify a user at an IP or domain like: "bugsbunny@127.0.0.1" or "porkypig@loonytunes.com". If you are new to SIP, you may need to ask your network administrator or experiment to find the right format for your carrier or the network to which you are connecting.

Examples
The example below shows a chunk of code that dials a call and then switches based on the Dial Result.
public void DialOut()
{
  // 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";

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

  // Branch based on what happens to the call
  switch (dialResult)
  {
    case DialResult.Connected:
    // Put your script for a connection here
    break;
    case DialResult.NoAnswer:
    // Put code to move on or do what you want with a No Answer 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;
  }
}
See Also