Skip to content

Commit 4baf8ff

Browse files
Merge pull request #230751 from tinaharter/QuickStartsForLobbyAdmitAndReject
Add quick starts for lobby admit and reject
2 parents 7ec4e6c + bda6e6e commit 4baf8ff

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: Admit and reject users from Teams meeting lobby
3+
titleSuffix: An Azure Communication Services how-to guide
4+
description: Use Azure Communication Services SDKs to admit or reject users from Teams meeting lobby.
5+
author: tinaharter
6+
ms.author: tinaharter
7+
ms.service: azure-communication-services
8+
ms.subservice: teams-interop
9+
ms.topic: how-to
10+
ms.date: 03/14/2023
11+
ms.custom: template-how-to
12+
13+
---
14+
15+
# Manage Teams meeting lobby
16+
17+
APIs lobby admit and reject on `Call` or `TeamsCall` class allow users to admit and reject participants from Teams meeting lobby.
18+
19+
In this article, you will learn how to admit and reject participants from Microsoft Teams meetings lobby by using Azure Communication Service calling SDKs.
20+
21+
## Prerequisites
22+
23+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
24+
- A deployed Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
25+
- A user access token to enable the calling client. For more information, see [Create and manage access tokens](../../quickstarts/access-tokens.md).
26+
- Optional: Complete the quickstart to [add voice calling to your application](../../quickstarts/voice-video-calling/getting-started-with-calling.md)
27+
28+
User ends up in the lobby depending on Microsoft Teams configuration. The controls are described here:
29+
[Learn more about Teams configuration ](../../concepts/interop/guest/teams-administration.md)
30+
31+
Microsoft 365 or Azure Communication Services users can admit or reject users from lobby, if they are connected to Teams meeting and have Organizer, Co-organizer, or Presenter meeting role.
32+
[Learn more about meeting roles](https://support.microsoft.com/office/roles-in-a-teams-meeting-c16fa7d0-1666-4dde-8686-0a0bfe16e019)
33+
34+
To update or check current meeting join & lobby policies in Teams admin center:
35+
[Learn more about Teams policies](/microsoftteams/settings-policies-reference#automatically-admit-people)
36+
37+
38+
### Get remote participant properties
39+
40+
The first thing is to get the `Call` or `TeamsCall` object of admitter: [Learn how to join Teams meeting](./teams-interoperability.md)
41+
42+
To know who is in the lobby, you could check the state of a remote participant. The `remoteParticipant` with `InLobby` state indicates that remote participant is in lobby.
43+
To get the `remoteParticipants` collection:
44+
45+
```js
46+
let remoteParticipants = call.remoteParticipants; // [remoteParticipant, remoteParticipant....]
47+
```
48+
49+
To get the state of a remote participant:
50+
51+
```js
52+
const state = remoteParticipant.state;
53+
```
54+
55+
You could check remote participant state in subscription method:
56+
[Learn more about events and subscription ](./events.md)
57+
58+
```js
59+
// Subscribe to a call obj.
60+
// Listen for property changes and collection updates.
61+
subscribeToCall = (call) => {
62+
try {
63+
// Inspect the call's current remote participants and subscribe to them.
64+
call.remoteParticipants.forEach(remoteParticipant => {
65+
subscribeToRemoteParticipant(remoteParticipant);
66+
})
67+
// Subscribe to the call's 'remoteParticipantsUpdated' event to be
68+
// notified when new participants are added to the call or removed from the call.
69+
call.on('remoteParticipantsUpdated', e => {
70+
// Subscribe to new remote participants that are added to the call.
71+
e.added.forEach(remoteParticipant => {
72+
subscribeToRemoteParticipant(remoteParticipant)
73+
});
74+
// Unsubscribe from participants that are removed from the call
75+
e.removed.forEach(remoteParticipant => {
76+
console.log('Remote participant removed from the call.');
77+
})
78+
});
79+
} catch (error) {
80+
console.error(error);
81+
}
82+
}
83+
84+
// Subscribe to a remote participant obj.
85+
// Listen for property changes and collection updates.
86+
subscribeToRemoteParticipant = (remoteParticipant) => {
87+
try {
88+
// Inspect the initial remoteParticipant.state value.
89+
console.log(`Remote participant state: ${remoteParticipant.state}`);
90+
if(remoteParticipant.state === 'InLobby'){
91+
console.log(`${remoteParticipant._displayName} is in the lobby`);
92+
}
93+
// Subscribe to remoteParticipant's 'stateChanged' event for value changes.
94+
remoteParticipant.on('stateChanged', () => {
95+
console.log(`Remote participant state changed: ${remoteParticipant.state}`);
96+
if(remoteParticipant.state === 'InLobby'){
97+
console.log(`${remoteParticipant._displayName} is in the lobby`);
98+
}
99+
else if(remoteParticipant.state === 'Connected'){
100+
console.log(`${remoteParticipant._displayName} is in the meeting`);
101+
}
102+
});
103+
} catch (error) {
104+
console.error(error);
105+
}
106+
}
107+
```
108+
109+
Before admit or reject `remoteParticipant` with `InLobby` state, you could get the identifier for a remote participant:
110+
111+
```js
112+
const identifier = remoteParticipant.identifier;
113+
```
114+
115+
The `identifier` can be one of the following `CommunicationIdentifier` types:
116+
117+
- `{ communicationUserId: '<COMMUNICATION_SERVICES_USER_ID'> }`: Object representing the Azure Communication Services user.
118+
- `{ phoneNumber: '<PHONE_NUMBER>' }`: Object representing the phone number in E.164 format.
119+
- `{ microsoftTeamsUserId: '<MICROSOFT_TEAMS_USER_ID>', isAnonymous?: boolean; cloud?: "public" | "dod" | "gcch" }`: Object representing the Teams user.
120+
- `{ id: string }`: object representing identifier that doesn't fit any of the other identifier types
121+
122+
### Start lobby operations
123+
124+
To admit, reject or admit all users from the lobby, you can use the `admit`, `rejectParticipant` and `admitAll` asynchronous APIs:
125+
126+
You can admit specific user to the Teams meeting from lobby by calling the method `admit` on the object `TeamsCall` or `Call`. The method accepts identifiers `MicrosoftTeamsUserIdentifier`, `CommunicationUserIdentifier`, `PhoneNumberIdentifier` or `UnknownIdentifier` as input.
127+
128+
```js
129+
await call.admit(identifier);
130+
```
131+
132+
You can also reject specific user to the Teams meeting from lobby by calling the method `rejectParticipant` on the object `TeamsCall` or `Call`. The method accepts identifiers `MicrosoftTeamsUserIdentifier`, `CommunicationUserIdentifier`, `PhoneNumberIdentifier` or `UnknownIdentifier` as input.
133+
134+
```js
135+
await call.rejectParticipant(identifier);
136+
```
137+
138+
You can also admit all users in the lobby by calling the method `admitAll` on the object `TeamsCall` or `Call`.
139+
140+
```js
141+
await call.admitAll();
142+
```
143+
144+
## Next steps
145+
- [Learn how to manage calls](./manage-calls.md)
146+
- [Learn how to manage Teams calls](../cte-calling-sdk/manage-calls.md)
147+
- [Learn how to join Teams meeting](./teams-interoperability.md)
148+
- [Learn how to manage video](./manage-video.md)

articles/communication-services/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ items:
204204
href: how-tos/calling-sdk/manage-video.md
205205
- name: Manage Teams calling
206206
href: how-tos/cte-calling-sdk/manage-calls.md
207+
- name: Manage Teams meeting Lobby
208+
href: how-tos/calling-sdk/lobby-admit-and-reject.md
207209
- name: Record calls
208210
href: how-tos/calling-sdk/record-calls.md
209211
- name: Show transcription state

0 commit comments

Comments
 (0)