Install Bot Manager Direct Line UCC plugin
This page describes the functionality of the Bot Framework direct line UCC A Unified Contact Center, or UCC, is a queue of interactions (voice, email, IM, etc.) that are handled by Agents. Each UCC has its own settings, IVR menus and Agents. Agents can belong to one or several UCCs and can have multiple skills (competencies). A UCC can be visualized as a contact center “micro service”. Customers can utilize one UCC (e.g. a global helpdesk), a few UCC’s (e.g. for each department or regional office) or hundreds of UCC’s (e.g. for each bed at a hospital). They are interconnected and can all be managed from one central location. plugin (hereafter 'plugin'). It covers installation steps of the plugin and a sample bot, however it won't go in detail on how to write a Bot Framework bot. When you want to write your own Bot Framework bot, please see the Microsoft website for documentation: https://botframework.com.
This plugin fits the gap between the UCC and Bot Framework bots hosted online. It makes redirecting incoming chat sessions to any Bot Framework bot possible (it will act as a proxy between UCC and Bot Framework). A short summary of the functionalities of this plugin can be found below:
-
Expose a Bot Framework bot as a UCC chat endpoint
-
Expose a Bot Framework bot as a webchat endpoint
-
Bot Framework bot can escalate the conversation to an agent
There are some limitations of this plugin:
-
No support for IsTyping indicator yet (UCC API needs changes)
-
No support for customer DisplayName yet (UCC API needs changes)
-
Displaying cards (when we are going to support this, only Adaptive Cards Adaptive Cards are preformatted boilerplate messages that can be selected by an agent to be sent to a client. They are written using an open card exchange format that allows the developers to 'write once' and share with any compliant host application standard will be supported)
-
Attachments like photos, documents, etc.
-
Chat history (UCC API and UCC code needs changes)
-
Only one bot per UCC can be configured
Technical notes
-
The plugin connects through a Websocket to wss://directline.botframework.com , make sure to allow it in the firewall configuration.
-
The plugin sends message via a REST interface to https://directline.botframework.com , make sure to allow it in the firewall configuration.
-
The plugin is tightly coupled with the UCC Plugin Framework SDK.
-
Whenever a chat is received on an IDR Interactive Dialogue Response (IDR) is an application to take orders via keypad or button through a computer. By choosing menu options the contact receives information, without the intervention of a human operator, or will be forwarded to the appropriate Agent. chat endpoint the plugin will intercept the chat and redirect it to Bot Framework (BFW).
-
A Create Conversation POST HTTP request will be sent to BFW.
-
A Websocket connection will be established to BFW (for realtime inbound messaging).
-
Everytime a user sends a message it will be sent to BFW using a POST HTTP request.
-
The bot can offer Actions which the UCC performs, like ChangeSkill to hunt an agent. This is done by offering a JSON object in the ChannelData property of a BFW activity.
-
-
When the plugin is unable to redirect the chat to Bot Framework, the default UCC behavior becomes effective (IDR questions flow).
Installation
To install the plugin, just follow these steps below:
-
Copy the plugin to a desired location on the same machine as the UCC runs at. Also make sure the Service Account has the right permissions to access (read and execute) the plugin.
-
In the UCC's config.xml append the <UnifiedContactCenter> element with the following element:
CopyXML<Plugin name="DirectLinePlugin" isIdentityPlugin="true" path="<directory path to the dll file of the plugin>" file="Wsp.Anywhere365.Ucc.Plugin.BotFrameworkDirectLine.dll"/>
-
Ensure EnableIDR is set to true in the UCC's settings list (sharepoint)
-
Create an IDR endpoint (chat endpoint without skill set)
-
Every IDR endpoint will act as bot
Configuration
The plugin needs a Direct Line key which can be set through the PluginSettings list on the UCC's sharepoint site. If the page is not visible on the main overview of the sharepoint site, you will find it under site contents of the site. Add the following setting to the PluginSettings list:
-
Setting: DirectLineKey
-
Value: <the directline key of the Bot Framework bot>
-
Scope: DirectLine
Usage
When installation and configuration steps are done, just start the UCC in console or as a service. Start a chat with the created chat endpoint. The demo bot just welcomes you and repeats everything you say. When you send a message with text hunt the bot will send a ChangeSkill action with the skill InstantMessaging. The agent with this chatskill will be hunted. If everything is working you should see something like the screenshot below.
UCC Actions
The Bot can perform UCC actions like a handover to an actual agent. The actions supported by the plugin are documented below:
ChangeSkill
The Bot can decide to hand the conversation over to an agent. This works by issuing the ChangeSkill action on the Bot Framework ChannelData object:
Adaptive Cards support
At this moment the bot doesn't support Adaptive Cards. However the FallbackText field of an adaptive card is sent to the user. A requirement is to set the correct attachment contenttype "application/vnd.microsoft.card.adaptive".
Demo bot code
The demo bot contains the following code to demonstrate the functionalities:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Schema;
namespace Microsoft.BotBuilderSamples.Bots
{
public class EchoBot : ActivityHandler
{
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
if (turnContext.Activity.Text?.Equals("hunt", StringComparison.InvariantCultureIgnoreCase) ?? false)
{
var activity = MessageFactory.Text("OK!");
activity.ChannelData = new
{
Type = "ChangeSkill",
Data = new {
Skill = "InstantMessaging"
}
};
await turnContext.SendActivityAsync(activity, cancellationToken);
return;
}
await turnContext.SendActivityAsync(MessageFactory.Text($"Echo: {turnContext.Activity.Text}"), cancellationToken);
}
protected override async Task OnMembersAddedAsync(IList<ChannelAccount> membersAdded, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
foreach (var member in membersAdded)
{
if (member.Id != turnContext.Activity.Recipient.Id)
{
await turnContext.SendActivityAsync(MessageFactory.Text($"Hello and welcome!"), cancellationToken);
}
}
}
}
}