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.
- 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
- In Azure portal, go to Azure Active Directory -> App registrations -> New registration.
- Register an app.
- 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
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
- User.Read
For more details on adding above graph permissions, checkout Call Permissions and User Permissions
- User.Read
- Add following Application permissions for Call
- Add Redirect URI
- Consent the permissions
- Go to "https://login.microsoftonline.com/common/adminconsent?client_id=<app_id>&state=<any_number>&redirect_uri=<app_redirect_url>"
- Sign in with a tenant admin
- Consent for the whole tenant.
- 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
-
Clone the repo
git@github.com: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.
-
Enabling "supportsCalling" in manifest
-
Enable RSC permission in manifest
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.