Teams Bot unable to receive Teams Meeting events using TeamsActivityHandler

Copper Contributor

Hi,

 

We have made a teams bot using nodejs that we uploaded to teams as an app. We would like the bot to listen for events during meetings, but it is not receiving any events relating to meetings. We are using the TeamsActivityHandler to listen for these events. For example, we have been trying: 

 

        this.onTeamsMeetingStartEvent(async (meeting, context, next) => {
            return this.handleMeetingStart(meeting, context, next);
        });

 

 

Here is the manifest: 

 

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
    "version": "1.0.0",
    "manifestVersion": "1.16",
    "id": {id},
    "packageName": "com.microsoft.teams.extension",
    "name": {
        "short": "Querious Development",
        "full": ""
    },
    "developer": {
        "name": "name example",
        "websiteUrl": "https://www.example.com",
        "privacyUrl": "https://www.example.com",
        "termsOfUseUrl": "https://www.example.com/privacy"
    },
    "description": {
        "short": "A Short Description",
        "full": "Assists in calls"
    },
    "icons": {
        "outline": "outline.png",
        "color": "color.png"
    },
    "accentColor": "#FFFFFF",
    "staticTabs": [
        {
            "entityId": "conversations",
            "scopes": [
                "personal"
            ]
        },
        {
            "entityId": "about",
            "scopes": [
                "personal"
            ]
        }
    ],
    "bots": [
        {
            "botId": {bot id},
            "scopes": [
                "personal",
                "team",
                "groupChat"
            ],
            "isNotificationOnly": false,
            "supportsCalling": true,
            "supportsVideo": true,
            "supportsFiles": false
        }
    ],
    "composeExtensions": [
        {
            "botId": {bot id},
            "commands": [],
            "canUpdateConfiguration": false
        }
    ],
    "validDomains": [],
    "devicePermissions": [
        "notifications",
        "media"
    ],
    "meetingExtensionDefinition": {
        "scenes": [],
        "supportsStreaming": true,
        "supportsAnonymousGuestUsers": true
    },
    "authorization": {
        "permissions": {
            "resourceSpecific": [
                {
                    "name": "ChatMessage.Read.Chat",
                    "type": "Application"
                },
                {
                    "name": "ChatMessage.Send.Chat",
                    "type": "Application"
                },
                {
                    "name": "TeamsActivity.Send.User",
                    "type": "Application"
                },
                {
                    "name": "MicrophoneStream.Read.User",
                    "type": "Delegated"
                },
                {
                    "name": "ChannelMeetingAudioVideo.Stream.Group",
                    "type": "Delegated"
                },
                {
                    "name": "ChannelMeetingIncomingAudio.Detect.Group",
                    "type": "Delegated"
                },
                {
                    "name": "Calls.AccessMedia.Chat",
                    "type": "Application"
                },
                {
                    "name": "Calls.JoinGroupCalls.Chat",
                    "type": "Application"
                },
                {
                    "name": "TeamsActivity.Send.Chat",
                    "type": "Application"
                },
                {
                    "name": "OnlineMeetingAudioVideo.Stream.Chat",
                    "type": "Delegated"
                },
                {
                    "name": "OnlineMeetingIncomingAudio.Detect.Chat",
                    "type": "Delegated"
                },
                {
                    "name": "OnlineMeetingParticipant.ToggleIncomingAudio.Chat",
                    "type": "Delegated"
                }
            ]
        }
    }
}

 

 

7 Replies

@kryan2000 - Could you please let us know the sample which you set up for this or any sample code snippet or document file you followed?

@kryan2000 - Could you please let us know the sample which you set up for this or any sample code snippet or document file you followed?

@Prasad_Das-MSFT 

Hi, This sample was setup from the vscode teams plugin that generate a bot for you.

 

I have also tried to setup a few times using the samples from https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples

 

Events are routed to the messaging endpoint, but it seems to be only events that are in teams outside the scope of an active meeting.

 

The events we are interested in is once a meeting is started and events happen in the meeting. All those don't even arrive at the codebase. (ngrok logging does not show calls coming in to the messaging endpoint.)

 

I have tried setting up a bot from the MS Teams Admin portal (https://dev.teams.microsoft.com/) as well as setting up an Azure Bot in Azure, both seem to have the same behavior.

 

Any further insight would be appreciated!
Eugene

@elrdevilliers - We tried to repro this using below sample but are getting meeting events. 

Could you please refer below sample which demonstrates how a bot can receive real-time meeting events: Microsoft-Teams-Samples/samples/meetings-events at main · OfficeDev/Microsoft-Teams-Samples (github....?

Hi Prasad,

Thanks for the assistance.
Changing the Teams app manifest to the one in the sample worked. It's now firing the events I am looking for.
I will eliminate what cause those to not fire in my previous configuration.
Thank you!
Eugene

@elrdevilliers - Glad to hear that it worked.

 

Thanks, 

Prasad Das

------------------------------------------------------------------------------------------ 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

If your Teams bot, developed using Node.js and employing the `TeamsActivityHandler`, is not receiving events related to meetings, there are a few steps you can take to troubleshoot the issue: 1. **Ensure App Permissions:** - Verify that your app has the necessary permissions to access meeting-related events. Check the app manifest and make sure the `meeting:participantAdded`, `meeting:participantRemoved`, or other relevant permissions are specified. 2. **Event Subscriptions:** - Ensure that your bot has subscribed to the appropriate events. For meeting-related events, make sure your app is subscribed to events like `meetingStart`, `meetingEnd`, `meetingUpdated`, etc. 3. **Bot Registration:** - Double-check the bot registration in the Teams App Studio or Azure Portal. Ensure that your bot is correctly configured to handle the meeting-related events. 4. **Activity Types:** - Confirm that your `TeamsActivityHandler` is configured to handle the specific activity types related to meetings. For example, `EventActivity`, `MessageActivity`, etc. 5. **Scope of Permissions:** - Review the documentation for any changes in the way meeting-related events are handled, as Microsoft Teams and its API might receive updates. Ensure your bot code aligns with the latest guidance. 6. **Logs and Debugging:** - Implement detailed logging in your bot code to capture any errors or messages related to the handling of meeting events. This can help identify issues during runtime. 7. **Update Dependencies:** - Ensure that your bot's dependencies (e.g., `botbuilder`, `@microsoft/teams`) are up to date. Outdated dependencies might not support newer features or event types. 8. **Test in Bot Emulator:** - Test your bot using the Microsoft Bot Framework Emulator. This can help isolate whether the issue is specific to the Teams environment or related to your bot's implementation. 9. **Community and Documentation:** - Check the Microsoft Teams developer documentation and community forums for any recent updates, known issues, or discussions related to meeting events. 10. **Consult Elgin Tarot Resolutions Support:** - If the issue persists, consider reaching out to Elgin Tarot Resolutions Support for more in-depth assistance. They can provide guidance based on your specific scenario and might have insights into any ongoing platform issues related to your Teams bot.