Jump to content

[C#] 3CX Windows Plugin to Open Ticket in PSA

Recommended Posts

Not sure how many people use 3CX for their phone systems, but our company utilizes the system and have recently adopted Pulseway as well. As a result, I have developed a plugin for 3CX Windows Client that opens a ticket as you pick up the phone from an incoming call. I have included the source code for reference if anyone else has a need for it.


  1. Create a new project. Select C# Language and create a new “Windows Class Library” project.
  2. Ensure that the project targets .NET Framework 4.5.1
  3. Add a reference to the library “MyPhoneCRMIntegration.dll” installed with 3CXPhone for Windows (usually C:\ProgramData\3CXPhone for Windows\PhoneApp).
  4. Rename Class1.cs to PulsewayTicketPlugin.cs and replace the code with the following:
using System;
using System.IO;

namespace _PulsewayTicketPlugin
    public class PulsewayTicketPlugin
        // Initialization of Variables
        private static PulsewayTicketPlugin instance = null;                                        // Holds the instance
        private MyPhonePlugins.IMyPhoneCallHandler callHandler = null;                              // Holds the handler
        private static MyPhonePlugins.CallState lastStatus = MyPhonePlugins.CallState.Undefined;    // Holds the last relevant phone status

        // Called upon loading 3CX Client
        public static void Loader(MyPhonePlugins.IMyPhoneCallHandler callHandler)
            // Create a new instance of the plugin
            instance = new PulsewayTicketPlugin(callHandler);

        // Constructor for plugin, to add event handler
        private PulsewayTicketPlugin(MyPhonePlugins.IMyPhoneCallHandler callHandler) {
            this.callHandler = callHandler;

            // As the status of the call changes, process the changes
            callHandler.OnCallStatusChanged += new MyPhonePlugins.CallInfoHandler(callHandler_OnCallStatusChanged);

        // Processes the status of the call
        private void callHandler_OnCallStatusChanged(object sender, MyPhonePlugins.CallStatus callInfo)
            // Process the current state
            //   - If it is ringing, a call is incoming, so we want to monitor it
            //   - If it has ended, no longer need to monitor it (happens when we end it or someone else picks it up)
            //   - Don't process other cases, not necessary
            switch (callInfo.State)
                case MyPhonePlugins.CallState.Ended: { lastStatus = MyPhonePlugins.CallState.Undefined; break; };
                case MyPhonePlugins.CallState.Ringing: { lastStatus = MyPhonePlugins.CallState.Ringing; break; };
                default: { break; };

            // If the phone was ringing and we picked it up, open a new ticket
            if (lastStatus == MyPhonePlugins.CallState.Ringing && callInfo.State == MyPhonePlugins.CallState.Connected)
                // Windows will automatically use the default application used to open URL's
  1. Build the DLL and place it into the 3CX Phone Directory (C:\ProgramData\3CXPhone for Windows\PhoneApp).
  2. Edit the 3CX Phone Configuration file (C:\ProgramData\3CXPhone for Windows\PhoneApp\3CXWin8Phone.user.config) and add the following:
<add key="CRMPlugin" value="CallNotifier,3CXPhoneTapiPlugin,PulsewayTicketPlugin"/>
  1. Reload your 3CX Windows Client and it should work with the next incoming call!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Basil62
      I want a program to always run on my computer. Is there a script that forces a program to restart after its process has been stopped?
      Thanks in advance
    • By dpbklyn
      Is there a way to exclude a particular disk (e:\) from the storage notifications?
    • By dpbklyn
      I am trying to automate our on-boarding process as much as possible.
      Is there a way to upload software to Pulseway (an A/V Application in this case) so we can trigger a script to install it on endpoints during on boarding?
      Thank you,
    • By AlanRTonn
      It would be nice if there was a view similar to the Time Sheet, Time Entries list but that showed the start and end time of each entry and only showed the time entries for the tickets that had entries for the week. Autotask had this and it was a great way to help remind me of what I did in the "gaps" between ticket time entries. Having all open tickets in my queue just clutters the current view. Maybe have a button on that view that toggles between all the open tickets and no time entries showing and having only time entries showing with start and end times. It looks like this:

    • By AlanRTonn
      Sometimes i am creating a ticket after i have already started work on the problem. Not ideal I know, but it happens. It happens enough that i would really like to be able to put in the time i started working on the problem and then hit the now choice and then hit a "Add time" or start tracking time button that continues to update the "now" or "end" field. that way i dont have to remember to hit that now button when i am done and hit the save button.