Here is a source code that a customer and I worked out to integrate the Zeacom call center with Infor Smart Office such that their customer service representatives can receive phone calls from their customers and automatically launch the respective M3 customer programs; this is similar to the previous integration work with Cisco Agent Desktop, Twilio, Skype, etc.
This source code is a script assembly in C#; for more information on script assemblies see here and here. The trick was to keep the z variable as a global variable, not as a local variable, so it can survive in memory for the event handlers.
You will need to reference the DLL files from your Zeacom software.
using Mango.UI; using MForms; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; namespace MForms.JScript { public class ZeacomAssembly { MLINTERFACELib.ZeacomMLI z = new MLINTERFACELib.ZeacomMLI(); public void Init(object element, object args, object controller, object debug) { string phoneExt = "1234"; if (z.AddExtension(phoneExt)) if (z.Initialise()) z.OnNewExtensionCall += OnNewExtensionCall; } private void OnNewExtensionCall(object Extension, object Call) { Application.Current.Dispatcher.Invoke(new ShowInformationDelegate(ShowInformation), new object[] {Extension, Call}); } private delegate void ShowInformationDelegate(object Extension, object Call); private void ShowInformation(object Extension, object Call) { ConfirmDialog.ShowInformationDialog("Incoming Call", "MLI Event: OnNewExtensionCall(: " + ((MLINTERFACELib.IExtension)Extension).AddressName + ", " + ((MLINTERFACELib.ICall)Call).CallReference + OutputCallInfo((MLINTERFACELib.ICall)Call)); } private string OutputCallInfo(MLINTERFACELib.ICall Call) { StringBuilder CallString = new StringBuilder(); if (Call != null) { CallString.AppendLine("CalledID = " + Call.CalledId); CallString.AppendLine("Caller = " + Call.Caller); CallString.AppendLine("CallOrigin = 0x" + Call.CallOrigin.ToString("X")); CallString.AppendLine("CallReason = 0x" + Call.CallReason.ToString("X")); CallString.AppendLine("CallReference = 0x" + Call.CallReference.ToString("X")); CallString.AppendLine("CLI = " + Call.CLI); CallString.AppendLine("CLIA = " + Call.CLIA); CallString.AppendLine("CLIF = " + Call.CLIF); CallString.AppendLine("CLIP = " + Call.CLIP); CallString.AppendLine("DNIS = " + Call.DNIS); CallString.AppendLine("Pilot = " + Call.Pilot); CallString.AppendLine("Query = " + Call.Query); CallString.AppendLine("QueryName = " + Call.QueryName); CallString.AppendLine("Queue = " + Call.Queue); CallString.AppendLine("RelatedRef = 0x" + Call.RelatedRef.ToString("X")); CallString.AppendLine("TransferredID = " + Call.TransferredId); CallString.AppendLine("TransferrerID = " + Call.TransferrerId); CallString.AppendLine("Trunk = " + Call.Trunk); CallString.AppendLine("Type = " + Call.Type); CallString.AppendLine("Wait = " + Call.Wait); if (Call.DataCallPayloadString.Length > 0) CallString.AppendLine("DataCallPayloadString = '" + Call.DataCallPayloadString + "'"); CallString.AppendLine(""); } return CallString.ToString(); } } }