592 Chapter 22 CTI Developer Toolkit
Common user scenarios and source code examples
This section details the following common user scenarios for developing custom integrations and applications
using the CTI Developer Toolkit
• Click to dial
• Call received notification
• Add call detail (using a third-party IVR)

Click to dial

NOTE: This code sample is not included in the sample project that is included with the CTI Developer Toolkit.
The following C# code fragment provides sample source code that can be used to build a console application
with click-to-dial functionality.
static void Main()
{
DeviceManager dm = DeviceManager.Instance;
string pbxIpAddress = "10.1.1.10";
string server = "the-CCM-server-IP-address-here";
string username = "your-username-here";
string password = "your-password-here";
Voice extension;
if (!dm.Connect(server, 5024, username, password))
{
Console.WriteLine("Uable to connect to server");
return;
}
extension = dm.GetDevice("1100", pbxIpAddress, DeviceType.Extension) as Voice;
if (extension == null)
{
Console.WriteLine("Unable to retrieve extension device");
return;
}
if (!extension.SetMonitor())
{
Console.WriteLine("Unable to monitor extension");
return;
}
device.MakeCall("16135990045");
dm.ReleaseAllDevices();
dm.Disconnect();
Console.WriteLine("Exit application");
}
This source code will connect to the specific Enterprise Server using the supplied username and password. It
then initiates a call from extension 1100 on the telephone system with IP address 10.1.1.10 to the phone
number 16135990045.