protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { LoggingService.AddLogEntry(LogLevel.Extended, "(Line " + tsInterface.LineNumber + ") Executing custom script at " + customScriptLocation, false); IMLScript imlScript = new IMLScript(); ScriptPage introPage = new ScriptPage(); introPage.ID = Guid.NewGuid().ToString(); /*if (LicenseService.IsTrialLicense()) { if (Properties.Settings.Default.WelcomeGreetingDelay > 0) { Delay welcomeDelay = new Delay(); welcomeDelay.DelayTime = Properties.Settings.Default.WelcomeGreetingDelay.ToString(); introPage.Actions.Add(welcomeDelay); } introPage.Actions.Add(ScriptCompilers.ScriptUtils.CreateExternalAction(ScriptCompilers.BaseExternalCommands.CALLBUTLERINTERNAL_PlayLicenseIntroGreeting.ToString(), "")); }*/ ScriptCompilers.ScriptUtils.ProcessPersonalizedGreeting(dataProvider, ref introPage, Properties.Settings.Default.CustomerID, tsInterface.IMLInterpreter.CallerDisplayName, tsInterface.IMLInterpreter.CallerUsername, tsInterface.IMLInterpreter.CallerHost, tsInterface.IMLInterpreter.DialedUsername); GotoPage gotoPage = new GotoPage(); gotoPage.Location = customScriptLocation; introPage.Actions.Add(gotoPage); imlScript.Pages.Add(introPage); tsInterface.IMLInterpreter.StartScript(imlScript, System.IO.Path.GetDirectoryName(customScriptLocation)); }
public override CallButler.Manager.Plugin.ProviderData EditProvider(CallButler.Manager.Plugin.ProviderData providerData) { ProviderEditorForm editorForm = new ProviderEditorForm(); editorForm.ProviderData = providerData; if (editorForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) return editorForm.ProviderData; else return null; }
public AutoDialerProcessor(Telecom.TelecomProviderBase telecomProvider, TelecomScriptInterface tsInterface, string jobID, string callID, string scriptToRun, string answeringMachineScriptToRun, string answeringMachineDetectionSettings, int timeout, System.Collections.Specialized.NameValueCollection scriptVariables, CallButler.Service.Plugin.CallButlerDialerPlugin dialerPlugin) { this.callID = callID; this.jobID = jobID; this.scriptLocation = scriptToRun; this.answeringMachineScriptLocation = answeringMachineScriptToRun; this.answeringMachineDetectionSettings = answeringMachineDetectionSettings; this.scriptVariables = scriptVariables; this.dialerPlugin = dialerPlugin; this.tsInterface = tsInterface; this.telecomProvider = telecomProvider; timeoutTimer = new System.Threading.Timer(new System.Threading.TimerCallback(TimeoutTimerProc), this, timeout * 1000, System.Threading.Timeout.Infinite); }
private void voicemailControl_GetVoicemailSound(object sender, CallButler.Manager.Controls.VoicemailEventArgs e) { string voicemailFile = GetVoicemailFilePath(e.Voicemail); if (!File.Exists(voicemailFile)) { // Download our voicemail file if we don't have it locally byte[] soundBytes = ManagementInterfaceClient.ManagementInterface.GetVoicemailSound(ManagementInterfaceClient.AuthInfo, e.Voicemail.ExtensionID, e.Voicemail.VoicemailID); if (soundBytes != null) { WOSI.Utilities.FileUtils.SaveBytesToFile(voicemailFile, soundBytes); } } e.SoundFilename = voicemailFile; }
protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { IMLScript imlScript; string moduleData = addonModule.OnStartScript(new CallButler.Service.Plugin.CallButlerScriptContext(tsInterface.IMLInterpreter)); if (addonModule.ModuleReturnsScriptPath) { imlScript = IMLScript.OpenScript(moduleData); } else { imlScript = IMLScript.LoadFromXML(moduleData); } tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); }
private void dgPersonalizedGreetings_EditDataRow(object sender, CallButler.Manager.Controls.DataRowEventArgs e) { EditPersonalizedGreeting((WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsRow)e.DataRow); }
public virtual void OnCallTemporarilyMoved(CallButler.Telecom.TelecomProviderBase telcomProvider, CallEventArgs e) { }
public virtual void OnAnswerDetectMachineGreetingFinished(CallButler.Telecom.TelecomProviderBase telecomProvider, LineEventArgs e) { }
protected virtual void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { }
public void StartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { OnStartProcessing(tsInterface, telecomProvider, dataProvider); }
void telecomProvider_IncomingTransfer(object sender, CallButler.Telecom.TransferEventArgs e) { if (e.LineNumber == lineNumber) { if (scriptProcessor != null) scriptProcessor.OnIncomingTransfer(telecomProvider, e); } }
public TelecomScriptInterface(CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider, Utilities.PluginManagement.PluginManager pluginManager, PBXRegistrarService pbxRegistrar/*, ExtensionStateService extStateService*/, int lineNumber) { this.telecomProvider = telecomProvider; this.dataProvider = dataProvider; this.lineNumber = lineNumber; this.pluginManager = pluginManager; this.pbxRegistrar = pbxRegistrar; //this.extStateService = extStateService; // Attach to our telecom provider events telecomProvider.CallEnded += new EventHandler<LineEventArgs>(telecomProvider_CallEnded); telecomProvider.DTMFToneRecognized += new EventHandler<CallInputEventArgs>(telecomProvider_DTMFToneRecognized); telecomProvider.FinishedSpeaking += new EventHandler<LineEventArgs>(telecomProvider_FinishedSpeaking); telecomProvider.SoundFinishedPlaying += new EventHandler<LineEventArgs>(telecomProvider_SoundFinishedPlaying); telecomProvider.TransferFailed += new EventHandler<LineEventArgs>(telecomProvider_TransferFailed); telecomProvider.TransferSucceeded += new EventHandler<LineEventArgs>(telecomProvider_TransferSucceeded); telecomProvider.CallConnected += new EventHandler<CallEventArgs>(telecomProvider_CallConnected); telecomProvider.CallFailed += new EventHandler<CallFailureEventArgs>(telecomProvider_CallFailed); telecomProvider.FaxToneDetected += new EventHandler<LineEventArgs>(telecomProvider_FaxToneDetected); telecomProvider.RemoteOnHold += new EventHandler<LineEventArgs>(telecomProvider_RemoteOnHold); telecomProvider.RemoteOffHold += new EventHandler<LineEventArgs>(telecomProvider_RemoteOffHold); telecomProvider.SpeechRecognized += new EventHandler<CallInputEventArgs>(telecomProvider_SpeechRecognized); telecomProvider.IncomingTransfer += new EventHandler<CallButler.Telecom.TransferEventArgs>(telecomProvider_IncomingTransfer); telecomProvider.CallTemporarilyMoved += new EventHandler<CallEventArgs>(telecomProvider_CallTemporarilyMoved); telecomProvider.AnswerDetectHuman += new EventHandler<LineEventArgs>(telecomProvider_AnswerDetectHuman); telecomProvider.AnswerDetectMachine += new EventHandler<LineEventArgs>(telecomProvider_AnswerDetectMachine); telecomProvider.AnswerDetectMachineGreetingFinished += new EventHandler<LineEventArgs>(telecomProvider_AnswerDetectMachineGreetingFinished); imlInterp = new WOSI.IVR.IML.IMLInterpreter(WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.ImlPluginsFolder)); // Attach to our interpreter events imlInterp.AsyncExternalAction += new EventHandler<AsyncExternalActionEventArgs>(imlInterp_AsyncExternalAction); imlInterp.DeleteLastRecording += new EventHandler(imlInterp_DeleteLastRecording); imlInterp.CopyLastRecording += new EventHandler<SoundFileEventArgs>(imlInterp_CopyLastRecording); imlInterp.HangUp += new EventHandler(imlInterp_HangUp); imlInterp.PlaySound += new EventHandler<PlaySoundEventArgs>(imlInterp_PlaySound); imlInterp.ScriptError += new EventHandler<ScriptErrorEventArgs>(imlInterp_ScriptError); imlInterp.ScriptFinished += new EventHandler(imlInterp_ScriptFinished); imlInterp.SpeakText += new EventHandler<SpeakTextEventArgs>(imlInterp_SpeakText); imlInterp.StartRecording += new EventHandler<SoundFileEventArgs>(imlInterp_StartRecording); imlInterp.StopRecording += new EventHandler<StopRecordingEventArgs>(imlInterp_StopRecording); imlInterp.SyncExternalAction += new EventHandler<SyncExternalActionEventArgs>(imlInterp_SyncExternalAction); imlInterp.TransferCall += new EventHandler<WOSI.IVR.IML.TransferEventArgs>(imlInterp_TransferCall); imlInterp.Call += new EventHandler<TelephoneNumberEventArgs>(imlInterp_Call); imlInterp.StopAllSounds += new EventHandler(imlInterp_StopAllSounds); imlInterp.ScriptStarted += new EventHandler(imlInterp_ScriptStarted); imlInterp.NewSpeechPhrases += new EventHandler<SpeechPhraseEventArgs>(imlInterp_NewSpeechPhrases); imlInterp.TraceMessage += new EventHandler<TraceEventArgs>(imlInterp_TraceMessage); imlInterp.JoinConference += new EventHandler<ConferenceEventArgs>(imlInterp_JoinConference); imlInterp.LeaveConference += new EventHandler(imlInterp_LeaveConference); // Create our default internal provider WOSI.CallButler.Data.CallButlerDataset.ProvidersDataTable defaultInternalProviderTable = new WOSI.CallButler.Data.CallButlerDataset.ProvidersDataTable(); defaultInternalProvider = defaultInternalProviderTable.NewProvidersRow(); defaultInternalProvider.CustomerID = Properties.Settings.Default.CustomerID; defaultInternalProvider.AutoDetectAudio = true; defaultInternalProvider.EnableRegistration = false; defaultInternalProvider.SupressOutboundUsername = false; if (Properties.Settings.Default.InternalSIPDomain != null && Properties.Settings.Default.InternalSIPDomain.Length > 0) defaultInternalProvider.Domain = Properties.Settings.Default.InternalSIPDomain; else { // Get the IP of this machine try { System.Net.IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); defaultInternalProvider.Domain = telecomProvider.LocalIPAddress; } catch { defaultInternalProvider.Domain = Environment.MachineName; } } defaultInternalProvider.IsDefault = false; }
public override void OnDTMFDigit(CallButler.Telecom.TelecomProviderBase telecomProvider, CallButler.Telecom.CallInputEventArgs e) { // If we're making an outbound call, make sure we relay any DTMF on to our remote caller if it is out of band DTMF if (!e.InAudio) { telecomProvider.SendDTMF(outboundTsInterface.LineNumber, e.InputString, Properties.Settings.Default.SendDTMFInAudio); } }
private void ProcessEndCall(CallButler.Telecom.TelecomProviderBase telecomProvider) { if (outboundTsInterface != null && conferenceID == 0) { telecomProvider.EndCall(outboundTsInterface.LineNumber); } else { telecomProvider.EndConference(conferenceID, true); } }
protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { string scriptLocation = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory) + "\\Outbound Call.xml"; if (File.Exists(scriptLocation)) { IMLScript imlScript = IMLScript.OpenScript(scriptLocation); tsInterface.IMLInterpreter.SetLocalVariable("HoldMusicLocation", WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.HoldMusicRootDirectory)); tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = dataProvider.GetExtensionNumber(Properties.Settings.Default.CustomerID, outboundExtensionNumber); // If the outbound ts interface is null, then this means we don't have any available lines to make outbound calls. // Also check to see if this extension is allowed to make outbound calls if (outboundTsInterface == null || (outboundExtensionNumber >=0 && extension != null && !extension.EnableOutboundCalls)) { tsInterface.IMLInterpreter.SignalCallFailure(); outboundTsInterface.Locked = false; } else { // Link to our outbound script processor and start it outboundTsInterface.ScriptProcessor.LinkScriptProcessor(this); outboundTsInterface.ScriptProcessor.StartProcessing(outboundTsInterface, telecomProvider, dataProvider); } } }
public virtual void OnIncomingTransfer(CallButler.Telecom.TelecomProviderBase telcomProvider, CallButler.Telecom.TransferEventArgs e) { }
public void ProcessExternalCommand(string command, string commandData, string eventToken, TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider, Utilities.PluginManagement.PluginManager pluginManager, PBXRegistrarService pbxRegistrar) { // Parse out our external event action if (Enum.IsDefined(typeof(BaseExternalCommands), command)) { BaseExternalCommands externalCommand = WOSI.Utilities.EnumUtils<BaseExternalCommands>.Parse(command); string languageID = "en"; switch (externalCommand) { case BaseExternalCommands.CALLBUTLERINTERNAL_StartAddonModule: CallButler.Service.Plugin.CallButlerAddonModulePlugin[] addonModules = pluginManager.GetAllPluginsOfType<CallButler.Service.Plugin.CallButlerAddonModulePlugin>(); foreach (CallButler.Service.Plugin.CallButlerAddonModulePlugin addonModule in addonModules) { if (addonModule.PluginID.ToString() == commandData) { try { // Make sure the module is licensed if (!addonModule.IsLicensed) break; // We found our module and we should load the script it uses tsInterface.ScriptProcessor = new AddonModuleScriptProcessor(addonModule); tsInterface.ScriptProcessor.StartProcessing(tsInterface, telecomProvider, dataProvider); return; } catch (Exception e) { LoggingService.AddLogEntry(WOSI.CallButler.ManagementInterface.LogLevel.ErrorsOnly, "Failed to load Addon-Module '" + addonModule.PluginName + "'\r\n\r\n" + e.Message + "\r\n\r\n" + e.StackTrace, true); } } } break; case BaseExternalCommands.CALLBUTLERINTERNAL_ReturnToCallFlowMainMenu: // Return to the Call flow main menu. tsInterface.ScriptProcessor = new StandardScriptProcessor(pluginManager, pbxRegistrar); ((StandardScriptProcessor)tsInterface.ScriptProcessor).StartFromMainMenu(tsInterface); break; case BaseExternalCommands.CALLBUTLERINTERNAL_PlayLicenseIntroGreeting: // If the line isn't in use, don't do anything if (!telecomProvider.IsLineInUse(tsInterface.LineNumber)) { tsInterface.IMLInterpreter.SignalEventCallback(eventToken); break; } // Read our intro sound bytes byte[] introSoundBytes = null; if (telecomProvider.AudioInputRate == 8000) { introSoundBytes = new byte[Properties.Resources.powered_by_8khz.Length]; Properties.Resources.powered_by_8khz.Read(introSoundBytes, 0, introSoundBytes.Length); } else if (telecomProvider.AudioInputRate == 16000) { introSoundBytes = new byte[Properties.Resources.powered_by_16khz.Length]; Properties.Resources.powered_by_16khz.Read(introSoundBytes, 0, introSoundBytes.Length); } // Play our license intro sound if (introSoundBytes != null) { telecomProvider.PlaySound(tsInterface.LineNumber, introSoundBytes); } break; case BaseExternalCommands.CALLBUTLERINTERNAL_PlaySystemSound: // If the line isn't in use, don't do anything if (!telecomProvider.IsLineInUse(tsInterface.LineNumber)) { tsInterface.IMLInterpreter.SignalEventCallback(eventToken); break; } // Get the sound with the current language languageID = tsInterface.IMLInterpreter.GetLocalVariable("LanguageID"); string soundFilename = GetSoundFileForLanguage(languageID, commandData); if (soundFilename == null) { // If we don't get a sound with the current language, try the default language soundFilename = GetSoundFileForLanguage(Properties.Settings.Default.DefaultLanguage, commandData); if (soundFilename == null) { // If we don't get a sound file with the default language, try english soundFilename = GetSoundFileForLanguage("en", commandData); if (soundFilename == null) { if (!File.Exists(soundFilename)) { // If the sound still doesn't exist, tell the IML interpreter to move on tsInterface.IMLInterpreter.SignalEventCallback(eventToken); break; } } } } // If we get here, our system sound should exist and we should play it. if(string.Compare(commandData, "ring.snd", true) == 0) telecomProvider.PlaySound(tsInterface.LineNumber, soundFilename, true); else telecomProvider.PlaySound(tsInterface.LineNumber, soundFilename, false); LoggingService.AddLogEntry(LogLevel.Extended, "(Line " + tsInterface.LineNumber + ") Playing sound at " + soundFilename, false); break; case BaseExternalCommands.CALLBUTLERINTERNAL_PlayGreeting: // If the line isn't in use, don't do anything if (!telecomProvider.IsLineInUse(tsInterface.LineNumber)) { tsInterface.IMLInterpreter.SignalEventCallback(eventToken); break; } // Get our current language languageID = tsInterface.IMLInterpreter.GetLocalVariable("LanguageID"); // Create our greetingID Guid greetingID = new Guid(commandData); // Get the greeting in our selected language WOSI.CallButler.Data.CallButlerDataset.GreetingsRow greeting = dataProvider.GetGreeting(Properties.Settings.Default.CustomerID, greetingID); if (greeting != null) { // Get the greeting for our specified language WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow localizedGreeting = dataProvider.GetLocalizedGreeting(Properties.Settings.Default.CustomerID, greetingID, languageID); if (localizedGreeting == null) { // If the greeting doesn't exist in the current language, try using the default language localizedGreeting = dataProvider.GetLocalizedGreeting(Properties.Settings.Default.CustomerID, greetingID, Properties.Settings.Default.DefaultLanguage); if (localizedGreeting == null) { // If the greeting doesn't exist in the default language, heck just return the first one that exists WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow[] localizedGreetings = greeting.GetLocalizedGreetingsRows(); if (localizedGreetings.Length > 0) localizedGreeting = localizedGreetings[0]; } } if (localizedGreeting != null) { // Determine how we should play this greeting WOSI.CallButler.Data.GreetingType greetingType = (WOSI.CallButler.Data.GreetingType)localizedGreeting.Type; switch (greetingType) { case WOSI.CallButler.Data.GreetingType.SoundGreeting: // Create our sound file path string soundFilePath = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingSoundRootDirectory) + "\\" + localizedGreeting.LanguageID + "\\" + greetingID.ToString() + ".snd"; if (File.Exists(soundFilePath)) { telecomProvider.PlaySound(tsInterface.LineNumber, soundFilePath, false); LoggingService.AddLogEntry(LogLevel.Extended, "(Line " + tsInterface.LineNumber + ") Playing sound at " + soundFilePath, false); } else tsInterface.IMLInterpreter.SignalEventCallback(eventToken); break; case WOSI.CallButler.Data.GreetingType.TextGreeting: // Speak our text string textToSpeak = tsInterface.IMLInterpreter.ParseVariableTokens(localizedGreeting.Data); // Take out any XML if (!WOSI.Utilities.StringUtils.IsWellFormedXml(textToSpeak)) textToSpeak = WOSI.Utilities.StringUtils.XmlEncodeString(textToSpeak); if (textToSpeak.Length > 0) { if (!localizedGreeting.IsVoiceNull() && localizedGreeting.Voice.Length > 0) textToSpeak = "<voice required=\"Name=" + localizedGreeting.Voice + "\">" + textToSpeak + "</voice>"; else if(Properties.Settings.Default.DefaultTTSVoice != null && Properties.Settings.Default.DefaultTTSVoice.Length > 0) textToSpeak = "<voice required=\"Name=" + Properties.Settings.Default.DefaultTTSVoice + "\">" + textToSpeak + "</voice>"; telecomProvider.SpeakText(tsInterface.LineNumber, textToSpeak); LoggingService.AddLogEntry(LogLevel.Extended, "(Line " + tsInterface.LineNumber + ") Speaking '" + textToSpeak + "'", false); } else { tsInterface.IMLInterpreter.SignalEventCallback(eventToken); } break; } } else { // If no greeting is found in the right language, tell the interpreter to move on tsInterface.IMLInterpreter.SignalEventCallback(eventToken); } } // If the greeting isn't found, tell the interpreter to go on else { tsInterface.IMLInterpreter.SignalEventCallback(eventToken); } break; } } else { OnExternalCommand(command, commandData, eventToken, tsInterface, telecomProvider, dataProvider); if (linkedScriptProcessor != null) linkedScriptProcessor.OnLinkedExternalCommand(command, commandData, eventToken, tsInterface, telecomProvider, dataProvider); } }
protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { tsInterface.IMLInterpreter.CallerDisplayName = string.Format("Calling {0}", numberToDial); tsInterface.IMLInterpreter.CallerHost = ""; tsInterface.IMLInterpreter.CallerUsername = ""; tsInterface.IMLInterpreter.DialedHost = ""; tsInterface.IMLInterpreter.DialedUsername = ""; string click2CallScriptLocation = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory) + "\\Click2Call Handler.xml"; if (System.IO.File.Exists(click2CallScriptLocation)) { IMLScript imlScript = IMLScript.OpenScript(click2CallScriptLocation); tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); } }
protected virtual void OnLinkedExternalCommand(string command, string commandData, string eventToken, TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { }
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), null, null, callMakerExtension.ExtensionNumber, false, true); // Allow this to answer calls again tsInterface.Locked = false; break; } tsInterface.IMLInterpreter.SignalEventCallback(eventToken); } }
public virtual void OnAnswerDetectHuman(CallButler.Telecom.TelecomProviderBase telecomProvider, LineEventArgs e) { }
protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { string voicemailScriptLocation = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory) + "\\Voicemail.xml"; if (File.Exists(voicemailScriptLocation)) { IMLScript imlScript = IMLScript.OpenScript(voicemailScriptLocation); // Set our script variables tsInterface.IMLInterpreter.SetLocalVariable("ExtensionID", extension.ExtensionID.ToString()); //if (Licensing.Management.AppPermissions.StatIsPermitted("Settings.MusicSettings")) //{ tsInterface.IMLInterpreter.SetLocalVariable("HoldMusicLocation", WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.HoldMusicRootDirectory)); //} /*else { tsInterface.IMLInterpreter.SetLocalVariable("HoldMusicLocation", ""); }*/ tsInterface.IMLInterpreter.SetLocalVariable("VoicemailRootFolder", WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.VoicemailRootDirectory)); tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); } }
public virtual void OnCallFailed(CallButler.Telecom.TelecomProviderBase telecomProvider, LineEventArgs e) { }
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(VoicemailExternalCommands), command)) { VoicemailExternalCommands externalCommand = WOSI.Utilities.EnumUtils<VoicemailExternalCommands>.Parse(command); switch (externalCommand) { case VoicemailExternalCommands.CALLBUTLERINTERNAL_NewVoicemail: { // Create a new voicemail record vmService.CreateVoicemail(new Guid(commandData), new Guid(tsInterface.IMLInterpreter.GetLocalVariable("ExtensionID")), tsInterface.IMLInterpreter.CallerDisplayName, tsInterface.IMLInterpreter.CallerHost, tsInterface.IMLInterpreter.CallerUsername); break; } case VoicemailExternalCommands.CALLBUTLERINTERNAL_VoicemailManagement: { tsInterface.ScriptProcessor = new VoicemailManagementScriptProcessor(extension, registrarService); tsInterface.ScriptProcessor.StartProcessing(tsInterface, telecomProvider, dataProvider); break; } } tsInterface.IMLInterpreter.SignalEventCallback(eventToken); } }
private void voicemailControl_VoicemailRead(object sender, CallButler.Manager.Controls.VoicemailEventArgs e) { ManagementInterfaceClient.ManagementInterface.PersistVoicemail(ManagementInterfaceClient.AuthInfo, Utils.TableUtils<WOSI.CallButler.Data.CallButlerDataset.VoicemailsDataTable>.CreateTableFromRow(e.Voicemail)); }
protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { string scriptLocation = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory) + "\\Receptionist Finder.xml"; if (File.Exists(scriptLocation)) { IMLScript imlScript = IMLScript.OpenScript(scriptLocation); // Set our script variables tsInterface.IMLInterpreter.SetLocalVariable("ExtensionID", extension.ExtensionID.ToString()); tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); } }
private void voicemailControl_VoicemailDeleted(object sender, CallButler.Manager.Controls.VoicemailEventArgs e) { // Delete remotely ManagementInterfaceClient.ManagementInterface.DeleteVoicemail(ManagementInterfaceClient.AuthInfo,e.Voicemail.ExtensionID, e.Voicemail.VoicemailID); }
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(ReceptionistFinderExternalCommands), command)) { ReceptionistFinderExternalCommands externalCommand = WOSI.Utilities.EnumUtils<ReceptionistFinderExternalCommands>.Parse(command); switch (externalCommand) { case ReceptionistFinderExternalCommands.CALLBUTLERINTERNAL_SendToAutoAttendant: { scriptService.ProcessAutoAttendantAnswer(tsInterface.LineNumber, tsInterface, false); break; } case ReceptionistFinderExternalCommands.CALLBUTLERINTERNAL_AnswerCall: { if (telecomProvider.IsLineInUse(tsInterface.LineNumber)) { if (tsInterface.Extension != null) telecomProvider.AnswerCall(tsInterface.LineNumber, true); else telecomProvider.AnswerCall(tsInterface.LineNumber, false); } break; } } } }
public CallButlerServiceContext(CallButler.Service.Plugin.ICallButlerDialerProvider dialerProvider) { this.dialerProvider = dialerProvider; }
public virtual void OnDTMFDigit(CallButler.Telecom.TelecomProviderBase telecomProvider, CallInputEventArgs e) { }