private static async Task PlayNumberValue(Step step, ICall call, PlayValueStepSettings stepSettings) { var promptSettings = new PlayerPromptSettings() { IsInterruptible = stepSettings.IsInterruptible, NextStep = step.GetStepFromConnector(next_step), Direction = stepSettings.Direction }; await call.PromptPlayer.DoStepAsync(promptSettings); var valueToPlay = DynamicState.GetProperty(call.CallState, stepSettings.Value); if (valueToPlay == null) { throw new ArgumentException("Value specified does not exist on CallState: " + stepSettings.Value); } await call.PromptPlayer.PlayNumberToLineAsync(valueToPlay.ToString(), stepSettings.Direction == Direction.Incoming ?call.CallState.GetIncomingLineId() : call.CallState.GetOutgoingLineId()); if (stepSettings.Direction != Direction.Outgoing) { call.CallState.AddStepToIncomingQueue(step.GetStepFromConnector(next_step)); } else { call.CallState.AddStepToOutgoingQueue(step.GetStepFromConnector(next_step)); } }
private static Task PlayMoneyValue(Step step, ICall call, PlayValueStepSettings stepSettings) { var numbersToPromptsConverter = new MoneyValueToPrompts(call.Logger); var valueToPlay = (decimal?)DynamicState.GetProperty(call.CallState, stepSettings.Value); if (valueToPlay == null) { throw new ArgumentException("Value specified does not exist on CallState: " + stepSettings.Value); } var prompts = numbersToPromptsConverter.GetPromptsForValue(valueToPlay.Value); var promptSettings = new PlayerPromptSettings() { IsInterruptible = stepSettings.IsInterruptible, NextStep = step.GetStepFromConnector(next_step), Prompts = prompts, Direction = stepSettings.Direction }; call.PromptPlayer.DoStepAsync(promptSettings); if (stepSettings.Direction != Direction.Outgoing) { call.CallState.AddStepToIncomingQueue(step.GetStepFromConnector(next_step)); } else { call.CallState.AddStepToOutgoingQueue(step.GetStepFromConnector(next_step)); } return(Task.CompletedTask); }
public Task DoStep(Step step, ICall call) { var stepSettings = step.NodeData.Properties as PlayValueStepSettings; if (stepSettings == null) { throw new ArgumentException("PlayValueStepProcessor called with invalid Step settings"); } var numbersToPromptsConverter = new MoneyValueToPrompts(); var valueToPlay = (decimal?)call.CallState.GetType().GetProperty(stepSettings.Value)?.GetValue(call.CallState); if (valueToPlay == null) { throw new ArgumentException("Value specified does not exist on CallState: " + stepSettings.Value); } var prompts = numbersToPromptsConverter.GetPromptsForValue(valueToPlay.Value); var promptSettings = new PlayerPromptSettings() { IsInterruptible = stepSettings.IsInterruptible, NextStep = step.GetStepFromConnector(NextStep), Prompts = prompts }; call.PromptPlayer.DoStep(promptSettings); call.AddStepToProcessQueue(step.GetStepFromConnector(NextStep)); return(Task.CompletedTask); }
public void DoStep(PlayerPromptSettings settings) { if (settings.IsInterruptible) { _arkeCall.InputProcessor.StartUserInput(true); } AddPromptsToQueue(settings.Prompts, settings.Direction); _arkeCall.CallStateMachine.Fire(settings.IsInterruptible ? Trigger.PlayInterruptiblePrompt : Trigger.PlayPrompt); }