I recently had a chance to play around with the Spokes SDK from Plantronics. The Spokes SDK allows you to receive events from Plantronics headsets. The events include notifications from buttons being pressed (call answer/end/mute/volume) as well as events if the user is wearing the headset.
Developer.plantronics.com has a number of good resources to get you started with Spokes, so I took the time to create an Add-In for the .net client to perform actions in CIC for the events coming from headset. For my purposes, I was testing with the DA45. Plantronics has a wide range of device types, but the DA45 is well suited for agents in a contact center. Using the sample code from their website, I was able to get a prototype up and running in almost no time at all, it might actually take me more time to write this blog than it did to write the code.
I was able to use the following events to perform actions in CIC.
|USB Plugged In
||Device State Changed
||Log device information to trace log and pop toast|
||Device State Changed
|Headset Connected To DA45
||Headset state change - In Range
||Set status to available.|
|Headset Unplugged from DA45
||Headset state change - out of range
||Set status to Away From Desk|
|Mute/Volume Buttons Pressed
|Headset talk Button Pressed
||Button Pressed - HeadsetButton_Talk
||Answer alerting calls or disconnect the currently connected call.|
Additionally, when the DA45 is connected, we will also trace out information to the log with product id, name, version and serial number.
We want to be able to change the user’s status when the device is connected/disconnected. The .net client AddIn API doesn’t have methods to be able to change our status so we’ll need to get the IceLib session out of the service provider.
_session = (Session)serviceProvider.GetService(typeof(Session));
If you do not have the IceLib license on your CIC server, GetService will return null.
In Plantronics\PlantronicsManager.cs, Registration for events from Spokes is simple enough.
public PlantronicsManager (IStatusManager statusManager,
_statusManager = statusManager;
_interactionManager = interactionManager;
_traceContext = traceContext;
_notificationService = notificationService;
m_sessionComManager = new SessionComManagerClass();
m_sessionManagerEvents = m_sessionComManager as ISessionCOMManagerEvents_Event;
m_comSession = m_sessionComManager.Register("Interaction Client Plantronics AddIn");
if (m_comSession != null)
m_sessionManagerEvents.DeviceStateChanged += OnDeviceStateChanged;
m_device = m_comSession.ActiveDevice;
if (m_device != null)
private void RegisterEvents()
m_deviceComEvents = m_device.DeviceEvents as IDeviceCOMEvents_Event;
m_deviceComEvents.ButtonPressed += new IDeviceCOMEvents_ButtonPressedEventHandler(OnButtonPressed);
m_deviceListenerEvents = m_device.DeviceListener as IDeviceListenerCOMEvents_Event;
if (m_deviceListenerEvents != null)
We are using dependency injection to pass services into the PlantronicsManager. Now when an event is raised from Spokes, we can call a method on the injected services to perform the action. In this case, when the headset button is pressed, we will either pickup an alerting call, or disconnect a connected call.
private void OnButtonPressed(object sender, _DeviceEventArgs e)
Debug.WriteLine("OnButtonPressed " + e.ToString());
_traceContext.Status("OnButtonPressed " + e.ToString());
if (e.ButtonPressed == HeadsetButton.HeadsetButton_Talk)
Code for this prototype is available https://github.com/InteractiveIntelligence/Plantronics/tree/master/PlantronicsClientAddIn. A demo video is available on the youtube http://www.youtube.com/watch?v=pFQC-6TcQSo
I encourage you to fork the code and use it in your own applications.