Skip to content

Commit 731127f

Browse files
Adding ACS WebSDK shared line appearance for CTE how-to
1 parent 7ffceb6 commit 731127f

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
author: charithgunaratna
3+
ms.service: azure-communication-services
4+
ms.topic: include
5+
ms.date: 02/04/2025
6+
ms.author: charithg
7+
---
8+
9+
> [!NOTE]
10+
> This API is provided as a preview for developers and might change based on feedback that we receive. Don't use this API in a production environment. To use this API, use the beta release of the Azure Communication Services Calling Web SDK (1.31.1-beta.1 or higher).
11+
12+
## Install the SDK
13+
14+
Use the `npm install` command to install the Azure Communication Services Common and Calling SDK for JavaScript:
15+
16+
```console
17+
npm install @azure/communication-common --save
18+
npm install @azure/communication-calling --save
19+
```
20+
21+
## Initialize required objects
22+
23+
A `CallClient` instance is required for most call operations. When you create a new `CallClient` instance, you can configure it with custom options like a `Logger` instance.
24+
25+
With the `CallClient` instance, you can create a `TeamsCallAgent` instance by calling the `createTeamsCallAgent`. This method asynchronously returns a `TeamsCallAgent` instance object.
26+
27+
The `createTeamsCallAgent` method uses `CommunicationTokenCredential` as an argument. It accepts a [user access token](../../../../quickstarts/identity/access-tokens.md).
28+
29+
You can use the `getDeviceManager` method on the `CallClient` instance to access `deviceManager`.
30+
31+
```js
32+
const { CallClient } = require('@azure/communication-calling');
33+
const { AzureCommunicationTokenCredential} = require('@azure/communication-common');
34+
const { AzureLogger, setLogLevel } = require("@azure/logger");
35+
36+
// Set the logger's log level
37+
setLogLevel('verbose');
38+
39+
// Redirect log output to console, file, buffer, REST API, or whatever location you want
40+
AzureLogger.log = (...args) => {
41+
console.log(...args); // Redirect log output to console
42+
};
43+
44+
const userToken = '<USER_TOKEN>';
45+
const callClient = new CallClient(options);
46+
const tokenCredential = new AzureCommunicationTokenCredential(userToken);
47+
const callAgent = await callClient.createTeamsCallAgent(tokenCredential, {displayName: 'optional Azure Communication Services user name'});
48+
const deviceManager = await callClient.getDeviceManager();
49+
await deviceManager.askDevicePermission({ audio: true, video: true });
50+
```
51+
52+
## Place a call on behalf of a Microsoft Teams user
53+
54+
Before placing a call behalf of a delegator, make sure delegate placing the call has `make calls` permission through [delegator call settings in Microsoft Teams](https://support.microsoft.com/office/share-a-phone-line-with-a-delegate-in-microsoft-teams-16307929-a51f-43fc-8323-3b1bf115e5a8)
55+
56+
To place a call on behalf of a Microsoft Teams user, specify `OnBehalfOfOptions` during start call. Replace `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` with the userId of the delegator and `yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy` with the userId of the callee.
57+
58+
```js
59+
const onBehalfOfOptions = { userId: { microsoftTeamsUserId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } }
60+
const teamsCallOptions = { onBehalfOfOptions: onBehalfOfOptions };
61+
const call = teamsCallAgent.startCall([{ microsoftTeamsUserId: "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" }], teamsCallOptions);
62+
```
63+
64+
## Receive a call on behalf of a Microsoft Teams user
65+
66+
To receive calls on behalf of a delegator,
67+
68+
- update delegate permission to enable "receive calls" through [delegator call settings in Microsoft Teams](https://support.microsoft.com/office/share-a-phone-line-with-a-delegate-in-microsoft-teams-16307929-a51f-43fc-8323-3b1bf115e5a8)
69+
- set up simultaneous ring for delegates through [delegator call settings in Microsoft Teams](https://support.microsoft.com/office/call-forwarding-call-groups-and-simultaneous-ring-in-microsoft-teams-a88da9e8-1343-4d3c-9bda-4b9615e4183e)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Tutorial - Shared Line Appearance
3+
description: Use Microsoft Teams Shared Line Appearance with Azure Communication Services Calling SDK.
4+
author: charithgunaratna
5+
ms.author: charithg
6+
ms.service: azure-communication-services
7+
ms.topic: how-to #Required; leave this attribute/value as-is
8+
ms.date: 02/04/2025
9+
---
10+
11+
# Shared Line Appearance
12+
13+
This article describes how to implement Microsoft Teams Shared Line Appearance with Azure Communication Services. Shared line appearance lets a user choose a delegate to make or handle calls on their behalf. This feature is helpful if a user has an administrative assistant who regularly handles the user's calls. In the context of shared line appearance, a manager is a Teams user who authorizes a delegate to make or receive calls on their behalf. A delegate is a M365 user who can make or receive calls on behalf of the delegator. You can find additional information about shared line appearance in [Teams documentation](https://learn.microsoft.com/microsoftteams/shared-line-appearance).
14+
15+
## Prerequisites
16+
17+
- An Azure account with an active subscription. See [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
18+
- A deployed Communication Services resource. See [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
19+
- A user access token to enable the calling client. For more information, see [Create and manage access tokens](../../quickstarts/identity/access-tokens.md).
20+
- Licensing requiremnets for delegator and delegates . See [Teams phone license](https://learn.microsoft.com/microsoftteams/shared-line-appearance#license-required).
21+
- Enable delegation and shared line appearance. See [Enable delegation](https://learn.microsoft.com/microsoftteams/shared-line-appearance#enable-delegation-and-shared-line-appearance)
22+
- Optional: Complete the quickstart to add voice calling to Microsoft Teams user. See [Quickstart: Add voice calling to Microsoft Teams user](../../quickstarts/voice-video-calling/get-started-call-to-teams-user.md).
23+
24+
## Support
25+
26+
### SDKs
27+
28+
The following table shows support for shared line appearance feature in individual Azure Communication Services SDKs.
29+
30+
| Support status | Web | Web UI | iOS | iOS UI | Android | Android UI | Windows |
31+
|----------------|-----|--------|--------|--------|----------|--------|---------|
32+
| Is Supported | ✔️ | | | | | | |
33+
34+
[!INCLUDE [Shared line appearance Client-side JavaScript](./includes/shared-line-appearance/shared-line-appearance-web.md)]
35+
36+
## Next steps
37+
38+
- [Learn how to manage calls](./manage-calls.md)
39+
- [Learn how to manage video](./manage-video.md)
40+
- [Learn how to record calls](./record-calls.md)
41+
- [Learn how to transcribe calls](./call-transcription.md)

0 commit comments

Comments
 (0)