Exemplo n.º 1
0
        private Task <Workflow> HandlePlayPromptOutcome(ConversationResult conversationResult, PlayPromptOutcome playPromptOutcome)
        {
            var outcomeEvent = new PlayPromptOutcomeEvent(conversationResult, CreateInitialWorkflow(), playPromptOutcome);
            var eventHandler = OnPlayPromptCompleted;

            return(InvokeHandlerIfSet(eventHandler, outcomeEvent));
        }
Exemplo n.º 2
0
 private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
 {
     System.Diagnostics.Trace.TraceInformation("We zitten in OnPlayPromptCompleted" + playPromptOutcomeEvent.ConversationResult.Id);
     //var callState = this.callStateMap[playPromptOutcomeEvent.ConversationResult.Id];
     //SetupRecording(playPromptOutcomeEvent.ResultingWorkflow);
     return(Task.FromResult(true));
 }
Exemplo n.º 3
0
        private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
        {
            var callState = this.callStateMap[playPromptOutcomeEvent.ConversationResult.Id];

            SetupInitialMenu(playPromptOutcomeEvent.ResultingWorkflow);

            return(Task.FromResult(true));
        }
Exemplo n.º 4
0
 private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
 {
     playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
     {
         CreateIvrOptions("Press 1 to record your voice, Press 2 to hangup.", 2, false)
     };
     return(Task.FromResult(true));
 }
Exemplo n.º 5
0
        private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
        {
            var callStateForClient = _callStateMap[playPromptOutcomeEvent.ConversationResult.Id];

            callStateForClient.InitiallyChosenMenuOption = null;
            SetupInitialMenu(playPromptOutcomeEvent.ResultingWorkflow);
            return(Task.FromResult(true));
        }
        /// <summary>
        /// Called when [play prompt completed].
        /// </summary>
        /// <param name="playPromptOutcomeEvent">The play prompt outcome event.</param>
        /// <returns></returns>
        private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
        {
            // Add Choices for the caller
            telemetryClient.TrackTrace($"PlayPromptCompleted - {playPromptOutcomeEvent.ConversationResult.Id}");
            Recognize recognize = SetupInitialMenu();

            playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase> {
                recognize
            };
            return(Task.FromResult(true));
        }
Exemplo n.º 7
0
 private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
 {
     if (response.Count > 0)
     {
         silenceTimes = 0;
         var actionList = new List <ActionBase>();
         foreach (var res in response)
         {
             Debug.WriteLine($"Response ----- {res}");
         }
         actionList.Add(GetPromptForText(response));
         actionList.Add(GetRecordForText(string.Empty));
         playPromptOutcomeEvent.ResultingWorkflow.Actions = actionList;
         response.Clear();
     }
     else
     {
         if (sttFailed)
         {
             playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
             {
                 GetRecordForText("I didn't catch that, would you kindly repeat?")
             };
             sttFailed    = false;
             silenceTimes = 0;
         }
         else if (silenceTimes > 2)
         {
             playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
             {
                 GetPromptForText("Something went wrong. Call again later."),
                 new Hangup()
                 {
                     OperationId = Guid.NewGuid().ToString()
                 }
             };
             playPromptOutcomeEvent.ResultingWorkflow.Links = null;
             silenceTimes = 0;
         }
         else
         {
             silenceTimes++;
             playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
             {
                 GetSilencePrompt(2000)
             };
         }
     }
     return(Task.CompletedTask);
 }
Exemplo n.º 8
0
 private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
 {
     if (_response.Count > 0)
     {
         _silenceTimes = 0;
         var actionList = new List <ActionBase>();
         foreach (var res in _response)
         {
             Debug.WriteLine($"Resposta -- {res}");
         }
         actionList.Add(GetPromptForText(_response));
         actionList.Add(GetRecordForText(string.Empty));
         playPromptOutcomeEvent.ResultingWorkflow.Actions = actionList;
         _response.Clear();
     }
     else
     {
         if (_sttFailed)
         {
             playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
             {
                 GetRecordForText("Não entendi, poderia repetir?")
             };
             _sttFailed    = false;
             _silenceTimes = 0;
         }
         else if (_silenceTimes > 2)
         {
             playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
             {
                 GetPromptForText("Ocorreu um problema no sistema. Por favor, ligue novamente."),
                 new Hangup {
                     OperationId = Guid.NewGuid().ToString()
                 }
             };
             playPromptOutcomeEvent.ResultingWorkflow.Links = null;
             _silenceTimes = 0;
         }
         else
         {
             _silenceTimes++;
             playPromptOutcomeEvent.ResultingWorkflow.Actions = new List <ActionBase>
             {
                 GetSilencePrompt(2000)
             };
         }
     }
     return(Task.CompletedTask);
 }
Exemplo n.º 9
0
        private Task OnPlayPromptCompleted(PlayPromptOutcomeEvent playPromptOutcomeEvent)
        {
            var callState = this.callStateMap[playPromptOutcomeEvent.ConversationResult.Id];

            return(Task.FromResult(true));
        }