예제 #1
0
        private Task <Workflow> HandleHangupOutcome(ConversationResult conversationResult, HangupOutcome hangupOutcome)
        {
            var outcomeEvent = new HangupOutcomeEvent(conversationResult, CreateInitialWorkflow(), hangupOutcome);
            var eventHandler = OnHangupCompleted;

            return(InvokeHandlerIfSet(eventHandler, outcomeEvent));
        }
예제 #2
0
        private Task OnHangupCompleted(HangupOutcomeEvent hangupOutcomeEvent)
        {
            System.Diagnostics.Trace.TraceInformation("We zitten in OnHangupCompleted" + hangupOutcomeEvent.ConversationResult.Id);
            hangupOutcomeEvent.ResultingWorkflow = null;

            var callState       = this.callStateMap[hangupOutcomeEvent.ConversationResult.Id];
            var client          = new DirectLineClient(directLineSecret);
            var thisParticipant = callState.Participants.Single(t => t.Originator);

            var endConversationActivity = new Activity()
            {
                Type = "EndConversation",
                From = new ChannelAccount()
                {
                    Id = thisParticipant.DisplayName
                }
            };

            client.Conversations.PostActivityAsync(callState.Conversation.ConversationId, endConversationActivity);

            this.callStateMap.Remove(hangupOutcomeEvent.ConversationResult.Id);

            return(Task.FromResult(true));
        }
예제 #3
0
 private static Task OnHangupCompleted(HangupOutcomeEvent hangupOutcomeEvent)
 {
     hangupOutcomeEvent.ResultingWorkflow = null;
     return(Task.FromResult(true));
 }
 /// <summary>
 /// Called when [hangup completed].
 /// </summary>
 /// <param name="hangupOutcomeEvent">The hangup outcome event.</param>
 /// <returns></returns>
 private Task OnHangupCompleted(HangupOutcomeEvent hangupOutcomeEvent)
 {
     telemetryClient.TrackTrace($"HangupCompleted - {hangupOutcomeEvent.ConversationResult.Id}");
     hangupOutcomeEvent.ResultingWorkflow = null;
     return(Task.FromResult(true));
 }