- Joined
- May 10, 2017
- Messages
- 3
- Reaction score
- 5
Hey All,
I am trying to integrate busy Light for 3CX but i am not that good in C#
Want to change the the light colour if there is a call or the person available.
Got it working partially but i have some trouble reading the status of the 3CX.
Here is the code i written:
Hope you guys can help me
Thanks in advance
I am trying to integrate busy Light for 3CX but i am not that good in C#
Want to change the the light colour if there is a call or the person available.
Got it working partially but i have some trouble reading the status of the 3CX.
Here is the code i written:
Code:
using BusylightTester;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using MyPhonePlugins;
namespace MyCRMPlugins
{
[CRMPluginLoader]
public class MyCrmPlugin
{
private static MyCrmPlugin _instance;
private static IMyPhoneCallHandler _callHandler;
private Busylight.SDK busylight = null;
[CRMPluginInitializer]
public static void Loader(IMyPhoneCallHandler callHandler)
{
//show busylight form
frmMain frm = new frmMain();
frm.Show();
_instance = new MyCrmPlugin(callHandler);
}
public MyCrmPlugin(IMyPhoneCallHandler callHandler)
{
_callHandler = callHandler;
_callHandler.OnCallStatusChanged += CallHandlerOnOnCallStatusChanged;
_callHandler.OnMyPhoneStatusChanged += CallHandlerOnOnMyPhoneStatusChanged;
}
private void CallHandlerOnOnMyPhoneStatusChanged(object sender, MyPhoneStatus status)
{
frmMain frm = new frmMain();
frm.busylight.Light(Busylight.BusylightColor.Green);
}
private void CallHandlerOnOnCallStatusChanged(object sender, CallStatus callInfo)
{
frmMain frm = new frmMain();
frm.busylight.Light(Busylight.BusylightColor.Red);
}
private void callhandler_OnCallStatusChanged(object sender, CallStatus callInfo)
{
frmMain frm = new frmMain();
frm.busylight.Light(Busylight.BusylightColor.Red);
}
public CallStatus MakeCall(string destination)
{
frmMain frm = new frmMain();
frm.busylight.Light(Busylight.BusylightColor.Red);
return _callHandler.MakeCall(destination);
}
}
}
Hope you guys can help me
Thanks in advance