Skip to content

shsarda/MeetingEventsCallingBot

Repository files navigation

MeetingEventsCallingBot

Summary

This sample Bot adds itself to the call when meeting "Start" event is received and drops/removes itself from the call when all the participants have left the call. Meeting "End" event is received when the bot drops the call. The Bot also tracks participants in the call.
OnEventActivityAsync is called on meeting start/end event.
Samples are generally not production-ready or an out-of-the-box solution but are intended to show developers specific patterns for use in their applications. The functionality is bare bone, all it does is tracks participants in the call once the bot is added to the meeting.

Prerequisites

  • To test locally, you need Ngrok installed on your local machine. Make sure you've downloaded and installed both on your local machine. ngrok will tunnel requests from the Internet to your local computer and terminate the SSL connection from Teams.
    ex: https://%subdomain%.ngrok.io

Setup Guide

Step #1: Create AAD App

  • In Azure portal, go to Azure Active Directory -> App registrations -> New registration.
  • Register an app.
    • Provide app Name and choose Multitenant. Leave the redirect URI for now.
    • Create Client Secret

    • Note the Application (Client) Id and Client Secret for further steps.

Step #2: Register in Bot Service

  • Create a Bot Channel Registration in Azure in different tab. Auto create App ID and password

  • Create new Microsoft App Id and password.

    Fill Microsoft App Id and Password as values of Application Id and Client Secret from Step #1.
  • Set calling configuration in Teams channel. Add webhook for calling. ex. https://%subdomain%.ngrok.io

Step #3: Configure AAD App

Configure the AAD app created in Step #1.

  • Add necessary API permissions to the app.
    Go to API permissions -> Add a permission -> Microsoft Graph
    • Add following Application permissions for Call
      • Calls.Initiate.All
      • Calls.InitiateGroupCalls.All
      • Calls.JoinGroupCalls.All
      • Calls.JoinGroupCallsasGuest.All
    • Add following Delegated permissions for User
  • Add Redirect URI
    • Select Add a platform -> web
    • Enter the redirect URI for your app ex. https://%subdomain%.ngrok.io/
    • Next, Enable implicit grant by checking ID Token and Access Token
  • Consent the permissions

Step #4: Enable resource-specific consent (RSC) in your app

  • Sign in to the Azure portal as tenant admin.
  • Select Azure Active Directory -> Enterprise applications -> Consent and permissions -> User consent settings.
  • Allow group owner consent for all group owners. For a team owner to install an app using RSC, group owner consent must be enabled for that user.
  • Allow user consent for apps. For a chat member to install an app using RSC, user consent must be enabled for that user.
  • To understand more about enabling RSC permissions, checkout RSC

Step #5: Run the app locally

  • Clone the repo
    [email protected]:shsarda/MeetingEventsCallingBot.git

  • If you are using Visual Studio

    • Launch Visual Studio
    • File -> Open -> Project/Solution
    • Open MeetingEventsCallingBot -> MeetingEventsCallingBot.sln
  • Edit appsettings.json file

    • Update MicrosoftAppId/AppId and MicrosoftAppId/AppSecret as values of Application Id and Client Secret from Step #1.
    • Update BotBaseURL ex. https://%subdomain%.ngrok.io
  • Run ngrok using the port on which the project is running locally.

Step #6: Packaging and installing your app to Teams

  • Enabling "supportsCalling" in manifest

    • Add two additional settings supportsCalling and supportsVideo (already enabled in manifest for this sample)
  • Enable RSC permission in manifest

    • Enable OnlineMeeting.ReadBasic.Chat in manifest (already enabled in manifest for this sample)

Make sure the required values (such as App id) are populated in the manifest, Zip the manifest with the profile images and install it in Teams.

Step #7: Try out the app

  • Enable developer preview in your debugging Teams client.

  • Add app to a scheduled meeting. Join the meeting to use the app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published