ChannelResourceCallProgress Property |
Namespace: VoiceElements.Client
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 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.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.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; } } 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 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; default: // Handle no connection here break; } }