You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/tutorials/calling-widget/calling-widget-tutorial.md
+48-7Lines changed: 48 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,6 @@ ms.subservice: calling
15
15
16
16
# Get started with Azure Communication Services UI library calling to Teams Voice Apps
17
17
18
-

19
-
20
18
This project aims to guide developers to initiate a call from the Azure Communication Services Calling Web SDK to Teams Call Queue and Auto Attendant using the Azure Communication UI Library.
21
19
22
20
As per your requirements, you might need to offer your customers an easy way to reach out to you without any complex setup.
@@ -30,10 +28,13 @@ Following this tutorial will:
30
28
- Allow you to control your customers audio and video experience depending on your customer scenario
31
29
- Teach you how to build a widget for starting calls on your webapp using the UI library.
32
30
31
+

32
+
33
33
## Prerequisites
34
+
These steps are **needed** in order to follow this tutorial. Contact your Teams admin for the last two items to make sure you are set up appropriately.
34
35
35
36
-[Visual Studio Code](https://code.visualstudio.com/) on one of the [supported platforms](https://code.visualstudio.com/docs/supporting/requirements#_platforms).
36
-
-[Node.js](https://nodejs.org/), Active LTS and Maintenance LTS versions [Node 18 LTS](https://nodejs.org/en) is recommended. Use the `node --version` command to check your version.
37
+
-[Node.js](https://nodejs.org/), Active LTS (Long Term Support) and versions [Node 18](https://nodejs.org/en) is recommended. Use the `node --version` command to check your version.
37
38
- An Azure Communication Services resource. [Create a Communications Resource](../../quickstarts/create-communication-resource.md)
38
39
- Complete the Teams tenant setup in [Teams Call Queues](../../quickstarts/voice-video-calling/get-started-teams-call-queue.md)
39
40
- Working with [Teams Call Queues](../../quickstarts/voice-video-calling/get-started-teams-call-queue.md) and Azure Communication Services.
@@ -44,7 +45,20 @@ Following this tutorial will:
44
45
Only use this step if you're creating a new application.
45
46
46
47
To set up the react App, we use the `create-react-app` command line tool. This tool
47
-
creates an easy to run TypeScript application powered by React. This command creates a react application using TypeScript.
48
+
creates an easy to run TypeScript application powered by React.
49
+
50
+
To make sure that you have Node installed on your machine, run this command in PowerShell or the terminal to see your Node version:
51
+
52
+
```bash
53
+
node -v
54
+
```
55
+
56
+
If you don't have `create-react-app` installed on your machine, run the following command to install it as a global command:
57
+
58
+
```bash
59
+
npm install -g create-react-app
60
+
```
61
+
After that command is installed, run this next command to create a new react application to build the sample in:
48
62
49
63
```bash
50
64
# Create an Azure Communication Services App powered by React.
@@ -56,7 +70,7 @@ cd ui-library-calling-widget-app
56
70
57
71
### Get your dependencies
58
72
59
-
Then you need to update the dependency array in the `package.json` to include some packages from Azure Communication Services for the widget experience we're going to build to work:
73
+
Then, you need to update the dependency array in the `package.json` to include some packages from Azure Communication Services for the widget experience we're going to build to work:
60
74
61
75
```json
62
76
"@azure/communication-calling": "1.22.1",
@@ -68,7 +82,7 @@ Then you need to update the dependency array in the `package.json` to include so
68
82
"@fluentui/react": "~8.98.3",
69
83
```
70
84
71
-
Once you add these packages to your `package.json`, you’re all set to start working on your new project. In this tutorial, we are modifying the files in the `src` directory.
85
+
After you add these packages to your `package.json`, you're all set to start working on your new project. In this tutorial, we are modifying the files in the `src` directory.
Before we run the app, go to `App.tsx` and replace the placeholder values there with your Azure Communication Services Identities and the identifier for your Teams Voice application. Here are input values for the `token`, `userId` and `teamsAppIdentifier`.
642
+
643
+
`./src/App.tsx`
644
+
```typescript
645
+
/**
646
+
* Token for local user.
647
+
*/
648
+
const token ="<Enter your ACS Token here>";
649
+
650
+
/**
651
+
* User identifier for local user.
652
+
*/
653
+
const userId:CommunicationIdentifier= {
654
+
communicationUserId: "Enter your ACS Id here",
655
+
};
656
+
657
+
/**
658
+
* Enter your Teams voice app identifier from the Teams admin center here
teamsAppId: "<Enter your Teams Voice app id here>",
662
+
cloud: "public",
663
+
};
664
+
```
665
+
625
666
### Run the app
626
667
627
668
Finally we can run the application to make our calls! Run the following commands to install our dependencies and run our app.
@@ -642,7 +683,7 @@ Then when you action the widget button, you should see a little menu:
642
683
643
684

644
685
645
-
After you fill out your name click start call and the call should begin. The widget should look like so after starting a call:
686
+
After you fill out your name, click start call and the call should begin. The widget should look like so after starting a call:
646
687
647
688

0 commit comments