protected override void OnExternalCommand(string command, string commandData, string eventToken, TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { // Parse out our external event action if (Enum.IsDefined(typeof(Click2CallExternalCommands), command)) { Click2CallExternalCommands externalCommand = WOSI.Utilities.EnumUtils <Click2CallExternalCommands> .Parse(command); switch (externalCommand) { case Click2CallExternalCommands.CALLBUTLERINTERNAL_ExtensionNotAvailable: // Allow this to answer calls again tsInterface.Locked = false; break; case Click2CallExternalCommands.CALLBUTLERINTERNAL_ConnectCalls: // Check to see if this is a call to another extension int extensionNumber = 0; bool disableCallScreening = callMakerExtension == null ? false : true; if (int.TryParse(numberToDial, out extensionNumber)) { // If we're calling our own extension, send us to the voicemail management menu if (extensionNumber == callMakerExtension.ExtensionNumber) { callMakerInterface.ScriptProcessor = new VoicemailManagementScriptProcessor(callMakerExtension, scriptService.registrarService); callMakerInterface.ScriptProcessor.StartProcessing(callMakerInterface, telecomProvider, dataProvider); // Allow this to answer calls again tsInterface.Locked = false; break; } else { WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = dataProvider.GetExtensionNumber(Properties.Settings.Default.CustomerID, extensionNumber); if (extension != null) { scriptService.TransferToExtension(extensionNumber.ToString(), callMakerInterface, disableCallScreening); // Allow this to answer calls again tsInterface.Locked = false; break; } } } // Send the caller to main menu if (numberToDial == "*") { scriptService.SetupAutoAttendantAnswer(callMakerInterface.LineNumber, callMakerInterface); callMakerInterface.ScriptProcessor.StartProcessing(callMakerInterface, telecomProvider, dataProvider); // Allow this to answer calls again tsInterface.Locked = false; break; } // If we get here, we make an outbound call to an external number if (callMakerExtension != null) { scriptService.MakeOutboundCall(callMakerInterface, numberToDial, string.Format("{0} {1}", callMakerExtension.FirstName, callMakerExtension.LastName), callMakerExtension.ExtensionNumber, false, true); } // Allow this to answer calls again tsInterface.Locked = false; break; } tsInterface.IMLInterpreter.SignalEventCallback(eventToken); } }