|
ChannelResourceDial Method |
Dials the phone number or destination specified in the phonenumber parameter.
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public DialResult Dial(
string phonenumber
)
Public Function Dial (
phonenumber As String
) As DialResult
public:
DialResult Dial(
String^ phonenumber
)
member Dial :
phonenumber : string -> DialResult
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:
DialResultThe 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()
{
TelephonyServer m_TelephonyServer = new TelephonyServer();
ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();
string m_PhoneNumber = "2135551212";
DialResult dialResult = m_ChannelResource.Dial(m_PhoneNumber);
switch (dialResult)
{
case DialResult.Connected:
break;
case DialResult.NoAnswer:
break;
case DialResult.Busy:
break;
default:
break;
}
}
Public Sub DialOut()
Dim m_TelephonyServer As New TelephonyServer()
Dim m_ChannelResource As ChannelResource = m_TelephonyServer.GetChannel()
Dim m_PhoneNumber As String = "2135551212"
Dim dialResult__1 As DialResult = m_ChannelResource.Dial(m_PhoneNumber)
Select Case dialResult__1
Case DialResult.Connected
Exit Select
Case DialResult.NoAnswer
Exit Select
Case DialResult.Busy
Exit Select
Case Else
Exit Select
End Select
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