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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By ARoode
      Does anyone have an update script for making and removing snapshots in VMware?
      I would like to use it together with Windows update scripts to search and install updates.
    • By EricS
      I've seen some old posts about this and solutions in older versions that have since been removed. However, I don't see the settings or options in this iteration as of today.
      We monitor some generic services, ie Apache, and other proprietary services that are critical to our program running. At times they hiccup or run into an issue where they fail to start or stop. At this point we would want Pulseway to not only send a notification but also attempt to restart the service(s).
      Any way to accomplish this or any roadmap on getting that feature rolled in?
    • By Your PCMD
      I am curious to know why 3rd party patch mgmt. is an additional paid feature. Before I would get notified for like Adobe Reader needed an update, know I have to pay additional to get this notification?
      What else within the features we already get will be removed to a "module" that we have to pay additional for? I only oversee around 60 endpoints, so I am not a big player, but there are issues now that are making me look and trial other RMM solutions. 
      Today I logged into my dash-panel as I do everyday M-F only to be greeted with 53 notifications for critical updates for Windows. Going into to the systems one by one, I quickly realized that something is not right. When viewing the systems, it clearly stated there were updates for Windows needed, but going to the actual systems available updates, I see "No updates found". Is Windows itself considered a 3rd party now?
      While writing this:
      20 May 2019 08:45
      1 critical update is available on computer 'REDACTED' in group 'REDACTED - Workstations'.   Available Updates
      No Updates Found
      Last Checked: 20 May 2019 08:48    
    • By PaulWTech
      Hi Everyone, As everyone knows Windows Updates are not bullet proof and they cause problems periodically with examples being flashing screens on logins for touch screen machines, lost audio abilities, files going missing and so on.  The goal of this Topic is to provide a way for all the members of this forum to report issues with KB's either that they've experienced or that have been reported elsewhere thus allowing all those participating to determine if they want to adjust their global policies to hold off on a KB or make other changes.  Your participation is greatly appreciated and I'm sure other tech's will be thankful for the information provided.
      If you need to look up a KB this link is useful:
      Not confirmed, yet, but I believe this will show subsequent KB's related to a errant KB.
    • By LouwrensE
      Good day,
      Firstly I want to state that I am not familiar with this application and that this is the first time that I've worked with it so please go easy on me.
      So I need to setup Remote Access for one of our vendors. I created the account for him but when he tries to log in remotely it gives him an "unable to access remote server" error.
      Could someone point me in the right direction?
      With thanks
  • Create New...