How to add Teams Meeting to Chat in Dialogue Studio

Introduction

Dialogue Studio, the Anywhere365 low-code platform, allows you to add various API integrations to your dialogues. In this scenario we will be using Microsoft Graph to generate a Teams meeting, which we can use to extend our (Web)chat.

 

Preview

 

Prerequisites

 

Configure greeting

We are going to start with a “Incoming conversation” node. This node only listens to chat and is connected to our server using SignalR.

Steps:

  1. Drag and drop Incoming Call node.

  2. Open Node:

    1. Select / Configure server.

    2. Filter on Chat.

 

A chat session is started when a message is send. Therefore we need to wait for a response first. This is done with a Wait for Chat node.

Steps:

  1. Drag and drop Wait for Chat node.

  2. Connect end of Incoming Call node with begin Wait for Chat node.

 

Next is greeting the customer, this can be done with a “Say” node. In here you can type the text, that you want to communicate to the customer.

Steps:

  1. Drag and drop Say node.

  2. Open Node:

    1. Enter text you want to play.

  3. Connect end of Wait for Chat node with begin of Say node.

 

Generate Teams Meeting

Communicating with the Graph API , requires to be authenticated first.

Please follow the steps in this guide to continue.

 

Next we need to store the Teams meeting so we can use it after connecting with the Agent, because this is in a new session phase we need to store it in a Flow parameter. This is done using a function node.

Steps:

  1. Drag and drop a Function Node.

  2. Open Node:

    1. Fill in the following function:

      var sessions = flow.get('sessionStore') || {};

      if(sessions[msg.session.id] === undefined){

      sessions[msg.session.id] = {};

      }

      sessions[msg.session.id] = {

      'sessionid': msg.session.id,

      'joinUrl': msg.payload.joinUrl

      };

      flow.set('sessionStore', sessions);

      return msg;

  3. Connect the output of the previous node to the begin of the Function node.

 

Queuing the chat

Now that we have the Teams meeting stored in place, we can continue with an action. In this case we are continue to a Skill.

Note The Skill needs to exist on SharePoint, Learn More

Steps:

  1. Drag and drop Enqueue node.

  2. Open Node:

    1. Enter the name of the Skill.

  3. Connect the end of Function node with begin Enqueue node.

 

Sharing Teams Meeting when in dialogue

As soon as the conversation is connected with the agent, we want to share the join url to both participants. This phase starts with a InDialogue node.

Steps:

  1. Drag and drop InDialogue node.

  2. Open Node:

    1. Select / Configure server.

    2. Filter on Chat.

 

Next we need to pull the join url from the Flow parameter. This can be done using a Function node.

Steps:

  1. Drag and drop a Function Node.

  2. Open Node:

    1. Fill in the following function:

      var sessionstore = flow.get('sessionStore')

      msg.joinUrl = sessionstore[msg.session.id].joinUrl

      return msg;

  3. Connect the both outputs of the InDialogue node to the begin of the Function node.

 

Out last step is to send the join url to both participants. Because we already merged the output of the InDialogue node, we can just use a single Say node.

Steps:

  1. Drag and drop Say node.

  2. Open Node:

    1. Switch to msg and enter joinUrl.

  3. Connect end of Function node with begin of Say node.