Trouble with CallNotifier plugin

Status
Not open for further replies.

MWFBrad

Joined
Aug 11, 2016
Messages
6
Reaction score
0
Hello,

I'm trying to build a DLL based off this guide:
http://www.3cx.com/blog/docs/3cxphone-for-windows-api/

The goal is to launch a program when a call is finished, for now I'm just having it write to a file to show its working (it doesn't). Now I've followed all the steps in the above link, and it does not appear that 3CX is using my DLL. I don't see any smoking gun in the logs, and at this point I'm out of ideas.

config file:
http://pastebin.com/yV3TjUX0

DLL code:
http://pastebin.com/62HsFchx

Logs:
http://pastebin.com/2963AyZt

the DLL is sitting in C:\ProgramData\3CXPhone for Windows\PhoneApp
 
Do you get any exceptions?

Try something like this:

Code:
        private void callHandler_OnMyPhoneStatusChanged(object sender, MyPhonePlugins.MyPhoneStatus status)
        {
            if (callInfo.State == CallState.Ended)
            {
                string filePath = @"C:/Status.txt";

                using (StreamWriter writer = new StreamWriter(filePath, true))
                {
                    writer.WriteLine(callInfo.State);
                }
            }
        }
 
Hello,

Ensure you are using the correct Framework, 4.0. See Attachment.

Also, make use of try catch blocks in your code. Catch any exceptions and write to text file - like this:

Code:
private MyCRMPlugin(MyPhonePlugins.IMyPhoneCallHandler callHandler)
        {
            try
            {
                this.callHandler = callHandler;
                callHandler.OnCallStatusChanged += new MyPhonePlugins.CallInfoHandler(callHandler_OnCallStatusChanged);
                
                callHandler.OnMyPhoneStatusChanged += new MyPhonePlugins.MyPhoneStatusHandler(callHandler_OnMyPhoneStatusChanged);
            }
            catch (Exception ex)
            {
                string filePath = @"C:/Error.txt";

                using (StreamWriter writer = new StreamWriter(filePath, true))
                {
                    writer.WriteLine(DateTime.Now + Environment.NewLine + "Message: " + ex.ToString() + Environment.NewLine + "Stack Trace: " + ex.StackTrace);
                }
            }
        }
 

Attachments

  • screenTarget.PNG
    screenTarget.PNG
    18.5 KB · Views: 1,459

Attachments

  • 3cxCSharpscreenshot_1.JPG
    3cxCSharpscreenshot_1.JPG
    26.4 KB · Views: 1,445
Quick update,

I'm still trying to find a solution for this problem,

At this point I've tried reinstalling 3cx on my computer, running it in administrator mode, replacing the file writing with launching an executable, and using the 3CX CRM template to create a new one from scratch.

No luck, nothing works. If anyone has any ideas, I'm all ears.
 
Hello,

1. Is your 3CX license edition PRO/Enterprise? This is a requirement for the Phone API.
2. What OS are you working on?
 
Hello,

1. Is your 3CX license edition PRO/Enterprise? This is a requirement for the Phone API.
2. What OS are you working on?

We are using a Pro license, and I am running Windows 10 Pro.
 
Hello again,

I just replicated your DLL and ran it in our environment. It worked as it should. I used your first pastebin DLL post.

I'm also using Windows 10, version 1511, OS Build 10586.545

It sounds like you were quite meticulous of the setup of your DLL and following the documentation closely, therefore I would suggest you look at your environment. Your DLL is fine.

Good Luck!
 
Hi

You should add a new line in the 3CXWin8Phone.user.config (the one with key="CRMPlugin") only if it does NOT exist.

If such a line there is already there, then just add your plugin by appending a comma and the file name of your plugin .dll (without the .dll).

E.g

<add key="CRMPlugin" value="Plugin1,Plugin2,Plugin3,YourPlugin" />

Theo
 
antyxsoft said:
Hi

You should add a new line in the 3CXWin8Phone.user.config (the one with key="CRMPlugin") only if it does NOT exist.

If such a line there is already there, then just add your plugin by appending a comma and the file name of your plugin .dll (without the .dll).

E.g

<add key="CRMPlugin" value="Plugin1,Plugin2,Plugin3,YourPlugin" />

Theo

He has already done this. Check his 1st post, the Config File pastebin link.
 
antyxsoft said:
Hi

You should add a new line in the 3CXWin8Phone.user.config (the one with key="CRMPlugin") only if it does NOT exist.

If such a line there is already there, then just add your plugin by appending a comma and the file name of your plugin .dll (without the .dll).

E.g

<add key="CRMPlugin" value="Plugin1,Plugin2,Plugin3,YourPlugin" />

Theo


Thats it!! Once I deleted the other CRMPlugin Line, it worked. Oh wow, thank you. I had a fairly large project hanging on getting this working, and was really feeling the pressure, thank you so much.
 

Attachments

  • its alive.jpg
    its alive.jpg
    6.6 KB · Views: 1,399
MWFBrad said:
Thats it!! Once I deleted the other CRMPlugin Line, it worked.

Glad to hear it.

Theo.
 
Status
Not open for further replies.