Install Bot Manager Direct Line UCC plugin

Note Enterprise Plus License Only

This page describes the functionalities of the Bot Framework direct line UCCUCC stands for Unified Contact Center and consists of a queue that can be handled by Agents. Each UCC has its own settings, interactive voice response questions and Agents with specific skills. Agents can be member of, or sign up to, one or more UCCs. 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:


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 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



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:

    <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



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



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. Note: it can take some time the first time you talk to the bot as the demo bot is on a low performance Azure instance.


UCC Actions

The Bot can perform UCC actions like a handover to an actual agent. The actions supported by the plugin are documented below:



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:


"Type": "ChangeSkill",

"Data": {

"Skill": "<insert skill name here>"



​​​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/".


​​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);





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);