- Joined
- Oct 17, 2018
- Messages
- 2
- Reaction score
- 0
Hi,
I'm trying to build a windows client plugin, and used the code generator (https://www.3cx.com/blog/releases/crm-plugin-development/)
I have the 3cx client (15.5.12227.5), and are server is running 15.5.0 (Professional NFR license)
The code seems fine, builds.
I've configured it:
<add key="CRMPlugin" value="MyPlugin"/> (3CXWin8Phone.user.config)
And the dll is definitely being loaded (can't recompile whilst it's running, and if i change the above to MyPlugin2, it compains in the 3cx log).
But it doesn't seem to be using the plugin at all. The log file is never created, and there is nothing in the client logfile to suggest an issue. I added some code to log and popup message boxes, but they are never hit on initialisation, or changing state in the client.
Does this template work with more recent clients? Is there something else I have to do to enable this?
Thanks,
Dan
Plugin code follows:
using CRMPluginUtils;
using MyPhonePlugins;
using System;
using System.Windows.Forms;
namespace MyPlugin
{
public class MyPlugin : AbsCallNotifier
{
private static readonly object lockObj = new object();
private readonly MySession _session;
public void OnMyPhoneStatusChanged(IExtensionInfo extensionInfo, MyPhoneStatus status)
{
MessageBox.Show(String.Format("status changed"), "3CX", MessageBoxButtons.OK, MessageBoxIcon.Error);
onMyPhoneStatusChanged(extensionInfo, status);
}
public void OnCallStatusChanged(CallStatus callInfo)
{
onCallStatusChanged(null, callInfo);
}
public MyPlugin(IMyPhoneCallHandler callHandler)
: base(Parameters.LogFileName, callHandler)
{
LogHelper.Log(Environment.SpecialFolder.ApplicationData, Parameters.LogFileName, "Starting myplugin");
_session = new MySession();
MessageBox.Show(String.Format("initialising"), "3CX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
protected override ContactInfo onShowContact(string contactNumber, bool createIfNotFound)
{
lock (lockObj)
{
return _session.ShowContactRecord(contactNumber, createIfNotFound);
}
}
protected override void onStoreCallInformation(CallInformation callInformation)
{
lock (lockObj)
{
_session.StoreCallInformation(callInformation);
}
}
}
}
I'm trying to build a windows client plugin, and used the code generator (https://www.3cx.com/blog/releases/crm-plugin-development/)
I have the 3cx client (15.5.12227.5), and are server is running 15.5.0 (Professional NFR license)
The code seems fine, builds.
I've configured it:
<add key="CRMPlugin" value="MyPlugin"/> (3CXWin8Phone.user.config)
And the dll is definitely being loaded (can't recompile whilst it's running, and if i change the above to MyPlugin2, it compains in the 3cx log).
But it doesn't seem to be using the plugin at all. The log file is never created, and there is nothing in the client logfile to suggest an issue. I added some code to log and popup message boxes, but they are never hit on initialisation, or changing state in the client.
Does this template work with more recent clients? Is there something else I have to do to enable this?
Thanks,
Dan
Plugin code follows:
using CRMPluginUtils;
using MyPhonePlugins;
using System;
using System.Windows.Forms;
namespace MyPlugin
{
public class MyPlugin : AbsCallNotifier
{
private static readonly object lockObj = new object();
private readonly MySession _session;
public void OnMyPhoneStatusChanged(IExtensionInfo extensionInfo, MyPhoneStatus status)
{
MessageBox.Show(String.Format("status changed"), "3CX", MessageBoxButtons.OK, MessageBoxIcon.Error);
onMyPhoneStatusChanged(extensionInfo, status);
}
public void OnCallStatusChanged(CallStatus callInfo)
{
onCallStatusChanged(null, callInfo);
}
public MyPlugin(IMyPhoneCallHandler callHandler)
: base(Parameters.LogFileName, callHandler)
{
LogHelper.Log(Environment.SpecialFolder.ApplicationData, Parameters.LogFileName, "Starting myplugin");
_session = new MySession();
MessageBox.Show(String.Format("initialising"), "3CX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
protected override ContactInfo onShowContact(string contactNumber, bool createIfNotFound)
{
lock (lockObj)
{
return _session.ShowContactRecord(contactNumber, createIfNotFound);
}
}
protected override void onStoreCallInformation(CallInformation callInformation)
{
lock (lockObj)
{
_session.StoreCallInformation(callInformation);
}
}
}
}