Пример #1
0
        public override async Task <HandoffRecord> Escalate(ITurnContext turnContext, IEventActivity handoffEvent)
        {
            var account      = _creds.LpAccount;
            var clientId     = _creds.LpAppId;
            var clientSecret = _creds.LpAppSecret;

            var conversationRecord = await LivePersonConnector.EscalateToAgentAsync(turnContext, handoffEvent, account, clientId, clientSecret, _conversationHandoffRecordMap);

            return(new LivePersonHandoffRecord(turnContext.Activity.GetConversationReference(), conversationRecord));
        }
Пример #2
0
        public override async Task RouteActivityToExistingHandoff(ITurnContext turnContext, HandoffRecord handoffRecord)
        {
            var livePersonHandoffRecord = handoffRecord as LivePersonHandoffRecord;

            if (livePersonHandoffRecord != null)
            {
                var account = _creds.LpAccount;
                var message = LivePersonConnector.MakeLivePersonMessage(0,
                                                                        livePersonHandoffRecord.RemoteConversationId,
                                                                        turnContext.Activity.Text);

                await LivePersonConnector.SendMessageToConversationAsync(account,
                                                                         livePersonHandoffRecord.ConversationRecord.MessageDomain,
                                                                         livePersonHandoffRecord.ConversationRecord.AppJWT,
                                                                         livePersonHandoffRecord.ConversationRecord.ConsumerJWS,
                                                                         message).ConfigureAwait(false);
            }
        }