Windows client plugin not registering

Status
Not open for further replies.

DanP

Free User
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);
}
}
}
}
 
What you have created is a scripting plugin, to be loaded by the DotNetScriptPlugin, which is already running in 3CXPhone for Windows. You need to do the following:
1) Copy the C# project code to "C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin".

2) Create a text file "C:\Users\USERNAME\AppData\Roaming\3CXPhone for Windows\3CXCRM.ini" with the following content:
Code:
[DotNet Script Plug-in]
ScriptCount=1
Script_1_ProjectFolder=DotNetScripts\MyPlugin
Script_1_TypeName=MyPlugin.MyPlugin
Script_1_MyPhoneStatusChangedCallback_LoggedIn=OnMyPhoneStatusChanged
Script_1_MyPhoneStatusChangedCallback_LoggedOut=OnMyPhoneStatusChanged
Script_1_MyPhoneStatusChangedCallback_NoConnection=OnMyPhoneStatusChanged
Script_1_CallStatusChangedCallback_Connected=OnCallStatusChanged
Script_1_CallStatusChangedCallback_Dialing=OnCallStatusChanged
Script_1_CallStatusChangedCallback_Ended=OnCallStatusChanged
Script_1_CallStatusChangedCallback_Ringing=OnCallStatusChanged
Script_1_CallStatusChangedCallback_TryingToTransfer=OnCallStatusChanged
Script_1_CallStatusChangedCallback_WaitingForNewParty=OnCallStatusChanged

3) Restart 3CXPhone.

Please note that this feature is only available when you have a PRO license in your server.

If you want to build the DLL instead, you need to create the plugin using this approach (slightly different interface):
https://www.3cx.com/call-center/crm-integration/
 
Awesome! Thanks so much!
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei