This sample code shows how to track participants in the call by adding a Calling & Meeting bot. 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
- 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.JoinGroupCalls.All
- Calls.JoinGroupCallsasGuest.All
- Add following Application permissions for User
- User.Read.All
- Directory.Read.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.
-
Clone the repo
[email protected]:shsarda/callingbot-sample.git
-
If you are using Visual Studio
- Launch Visual Studio
- File -> Open -> Project/Solution
- Open callingbot-sample -> CallingMeetingBot.sln
-
Edit appsettings.json file
- Update AppId and 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.
Generate manifest by enabling "supportsCalling"
- Add two additional settings supportsCalling and supportsVideo (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.