protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { string callFlowScriptLocation = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory) + "\\Call Flow.xml"; IMLScript imlScript = new IMLScript(); ScriptPage introPage = new ScriptPage(); introPage.ID = Guid.NewGuid().ToString(); if (Properties.Settings.Default.WelcomeGreetingDelay > 0) { Delay welcomeDelay = new Delay(); welcomeDelay.DelayTime = Properties.Settings.Default.WelcomeGreetingDelay.ToString(); introPage.Actions.Add(welcomeDelay); } /*if (LicenseService.IsTrialLicense()) * { * 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); if (File.Exists(callFlowScriptLocation)) { GotoPage gotoPage = new GotoPage(); gotoPage.Location = callFlowScriptLocation; introPage.Actions.Add(gotoPage); imlScript.Pages.Add(introPage); } tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); }
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 static GotoPage CreateGotoPageAction(string pageID) { GotoPage gotoPage = new GotoPage(); gotoPage.PageID = pageID; return(gotoPage); }
public static bool ProcessPersonalizedGreeting(WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider, ref WOSI.IVR.IML.Classes.ScriptPage scriptPage, int customerID, string callerDisplayName, string callerPhoneNumber, string callerHost, string dialedPhoneNumber) { // Loop through our personalized greetings and see if we can find one that matches our caller WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsDataTable personalGreetings = dataProvider.GetPersonalizedGreetings(customerID); WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsRow personalizedGreeting = null; foreach (WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsRow pgRow in personalGreetings) { string matchExpression = ""; // Try our dialed number first if (pgRow.DialedUsername.Length > 0) { if (!pgRow.UseRegex) { matchExpression = pgRow.DialedUsername.Replace("*", ".*"); } else { matchExpression = pgRow.DialedUsername; } if (Regex.IsMatch(dialedPhoneNumber, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } // Next try our caller username/phone number if (pgRow.CallerUsername.Length > 0) { if (!pgRow.UseRegex) { matchExpression = pgRow.CallerUsername.Replace("*", ".*"); } else { matchExpression = pgRow.CallerUsername; } // First find by the caller number if (Regex.IsMatch(callerPhoneNumber, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } // Next try the host if (pgRow.CallerHost.Length > 0) { if (!pgRow.UseRegex) { matchExpression = pgRow.CallerHost.Replace("*", ".*"); } else { matchExpression = pgRow.CallerHost; } if (Regex.IsMatch(callerHost, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } // Next try the caller id/name if (pgRow.CallerDisplayName.Length > 0) { if (!pgRow.UseRegex) { matchExpression = pgRow.CallerDisplayName.Replace("*", ".*"); } else { matchExpression = pgRow.CallerDisplayName; } if (Regex.IsMatch(callerDisplayName, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } } // If we have a personalized greeting, tell the interpreter to play it if (personalizedGreeting != null && (!personalizedGreeting.PlayOnce || (personalizedGreeting.PlayOnce && !personalizedGreeting.HasPlayed))) { scriptPage.Actions.Add(ScriptUtils.CreateGreetingExternalAction(personalizedGreeting.PersonalizedGreetingID)); switch (personalizedGreeting.Type) { case (short)WOSI.CallButler.Data.PersonalizedGreetingType.CustomScript: GotoPage gotoCustomScript = new GotoPage(); gotoCustomScript.Location = personalizedGreeting.Data; scriptPage.Actions.Add(gotoCustomScript); break; case (short)WOSI.CallButler.Data.PersonalizedGreetingType.Hangup: scriptPage.Actions.Add(new HangupCall()); break; case (short)WOSI.CallButler.Data.PersonalizedGreetingType.SendToExtension: // Get the proper extension WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = dataProvider.GetExtension(customerID, new Guid(personalizedGreeting.Data)); if (extension != null) { TransferCall transferCall = new TransferCall(); transferCall.TransferTo = extension.ExtensionNumber.ToString(); transferCall.IsExtension = true; scriptPage.Actions.Add(transferCall); } break; case (short)WOSI.CallButler.Data.PersonalizedGreetingType.Module: ExternalAction moduleAction = new ExternalAction(); moduleAction.Async = false; moduleAction.Action = BaseExternalCommands.CALLBUTLERINTERNAL_StartAddonModule.ToString(); moduleAction.ParameterData = personalizedGreeting.Data; scriptPage.Actions.Add(moduleAction); break; } if (personalizedGreeting.PlayOnce) { personalizedGreeting.HasPlayed = true; dataProvider.PersistPersonalizedGreeting(personalizedGreeting); } return(true); } else { return(false); } }
protected override void OnStartProcessing(TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider) { string callFlowScriptLocation = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory) + "\\Call Flow.xml"; IMLScript imlScript = new IMLScript(); ScriptPage introPage = new ScriptPage(); introPage.ID = Guid.NewGuid().ToString(); if (Properties.Settings.Default.WelcomeGreetingDelay > 0) { Delay welcomeDelay = new Delay(); welcomeDelay.DelayTime = Properties.Settings.Default.WelcomeGreetingDelay.ToString(); introPage.Actions.Add(welcomeDelay); } /*if (LicenseService.IsTrialLicense()) { 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); if (File.Exists(callFlowScriptLocation)) { GotoPage gotoPage = new GotoPage(); gotoPage.Location = callFlowScriptLocation; introPage.Actions.Add(gotoPage); imlScript.Pages.Add(introPage); } tsInterface.IMLInterpreter.StartScript(imlScript, WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.SystemScriptsRootDirectory)); }
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 static GotoPage CreateGotoPageAction(string pageID) { GotoPage gotoPage = new GotoPage(); gotoPage.PageID = pageID; return gotoPage; }
public static bool ProcessPersonalizedGreeting(WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider, ref WOSI.IVR.IML.Classes.ScriptPage scriptPage, int customerID, string callerDisplayName, string callerPhoneNumber, string callerHost, string dialedPhoneNumber) { // Loop through our personalized greetings and see if we can find one that matches our caller WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsDataTable personalGreetings = dataProvider.GetPersonalizedGreetings(customerID); WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsRow personalizedGreeting = null; foreach (WOSI.CallButler.Data.CallButlerDataset.PersonalizedGreetingsRow pgRow in personalGreetings) { string matchExpression = ""; // Try our dialed number first if (pgRow.DialedUsername.Length > 0) { if (!pgRow.UseRegex) matchExpression = pgRow.DialedUsername.Replace("*", ".*"); else matchExpression = pgRow.DialedUsername; if (Regex.IsMatch(dialedPhoneNumber, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } // Next try our caller username/phone number if (pgRow.CallerUsername.Length > 0) { if (!pgRow.UseRegex) matchExpression = pgRow.CallerUsername.Replace("*", ".*"); else matchExpression = pgRow.CallerUsername; // First find by the caller number if (Regex.IsMatch(callerPhoneNumber, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } // Next try the host if (pgRow.CallerHost.Length > 0) { if (!pgRow.UseRegex) matchExpression = pgRow.CallerHost.Replace("*", ".*"); else matchExpression = pgRow.CallerHost; if (Regex.IsMatch(callerHost, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } // Next try the caller id/name if (pgRow.CallerDisplayName.Length > 0) { if (!pgRow.UseRegex) matchExpression = pgRow.CallerDisplayName.Replace("*", ".*"); else matchExpression = pgRow.CallerDisplayName; if (Regex.IsMatch(callerDisplayName, matchExpression, RegexOptions.IgnoreCase)) { personalizedGreeting = pgRow; break; } } } // If we have a personalized greeting, tell the interpreter to play it if (personalizedGreeting != null && (!personalizedGreeting.PlayOnce || (personalizedGreeting.PlayOnce && !personalizedGreeting.HasPlayed))) { scriptPage.Actions.Add(ScriptUtils.CreateGreetingExternalAction(personalizedGreeting.PersonalizedGreetingID)); switch (personalizedGreeting.Type) { case (short)WOSI.CallButler.Data.PersonalizedGreetingType.CustomScript: GotoPage gotoCustomScript = new GotoPage(); gotoCustomScript.Location = personalizedGreeting.Data; scriptPage.Actions.Add(gotoCustomScript); break; case (short)WOSI.CallButler.Data.PersonalizedGreetingType.Hangup: scriptPage.Actions.Add(new HangupCall()); break; case (short)WOSI.CallButler.Data.PersonalizedGreetingType.SendToExtension: // Get the proper extension WOSI.CallButler.Data.CallButlerDataset.ExtensionsRow extension = dataProvider.GetExtension(customerID, new Guid(personalizedGreeting.Data)); if (extension != null) { TransferCall transferCall = new TransferCall(); transferCall.TransferTo = extension.ExtensionNumber.ToString() ; transferCall.IsExtension = true; scriptPage.Actions.Add(transferCall); } break; case (short)WOSI.CallButler.Data.PersonalizedGreetingType.Module: ExternalAction moduleAction = new ExternalAction(); moduleAction.Async = false; moduleAction.Action = BaseExternalCommands.CALLBUTLERINTERNAL_StartAddonModule.ToString(); moduleAction.ParameterData = personalizedGreeting.Data; scriptPage.Actions.Add(moduleAction); break; } if (personalizedGreeting.PlayOnce) { personalizedGreeting.HasPlayed = true; dataProvider.PersistPersonalizedGreeting(personalizedGreeting); } return true; } else return false; }