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/quickstarts/voice-video-calling/includes/get-started/get-started-windows.md
+199-1Lines changed: 199 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ ms.author: rifox
9
9
In this quickstart, you learn how to start a call using the Azure Communication Services Calling SDK for Windows.
10
10
11
11
## [UWP](#tab/uwp)
12
+
12
13
You can download the sample app from [GitHub](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/Calling).
13
14
14
15
### Prerequisites
@@ -42,7 +43,7 @@ Right select your project and go to `Manage Nuget Packages` to install `Azure.Co
42
43
#### Request access
43
44
44
45
Go to `Package.appxmanifest` and select `Capabilities`.
45
-
Check `Internet (Client & Server)` to gain inbound and outbound access to the Internet. Check `Microphone` to access the audio feed of the microphone.
46
+
Check `Internet (Client & Server)` to gain inbound and outbound access to the Internet. Check `Microphone` to access the audio feed of the microphone. Check `WebCam` to access the camera of the device.
46
47
47
48
:::image type="content" source="../../media/windows/request-access.png" alt-text="Screenshot showing requesting access to Internet and Microphone in Visual Studio.":::
48
49
@@ -1407,3 +1408,200 @@ You can build and run the code on Visual Studio. For solution platforms, we supp
1407
1408
You can make an outbound call by providing a user ID in the text field and clicking the `Start Call` button. Calling `8:echo123` connects you with an echo bot, this feature is great for getting started and verifying your audio devices are working.
1408
1409
1409
1410
:::image type="content" source="../../media/windows/run-the-winui-app.png" alt-text="Screenshot showing running the WinUI quickstart app":::
1411
+
1412
+
1413
+
You can download the sample app from [GitHub](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/CallingWinUI).
1414
+
1415
+
### Prerequisites
1416
+
1417
+
To complete this tutorial, you need the following prerequisites:
1418
+
1419
+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1420
+
- Install [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) and [Windows App SDK version 1.2 preview 2](https://learn.microsoft.com/windows/apps/windows-app-sdk/preview-channel#version-12-preview-2-120-preview2).
1421
+
- Basic understanding of how to create a WinUI 3 app. [Create your first WinUI 3 (Windows App SDK) project](https://learn.microsoft.com/windows/apps/winui/winui3/create-your-first-winui3-app?pivots=winui3-packaged-csharp) is a good resource to start with.
1422
+
- A deployed Communication Services resource. [Create a Communication Services resource](../../../create-communication-resource.md). You need to **record your connection string** for this quickstart.
1423
+
- A [User Access Token](../../../identity/access-tokens.md) for your Azure Communication Service. You can also use the Azure CLI and run the command with your connection string to create a user and an access token.
1424
+
1425
+
1426
+
```azurecli-interactive
1427
+
az communication identity token issue --scope voip --connection-string "yourConnectionString"
1428
+
```
1429
+
1430
+
For details, see [Use Azure CLI to Create and Manage Access Tokens](../../../identity/access-tokens.md?pivots=platform-azcli).
1431
+
1432
+
### Setting up
1433
+
1434
+
#### Creating the project
1435
+
1436
+
In Visual Studio, create a new project with the **Blank App, Packaged (WinUI 3 in Desktop)** template to set up a single-page WinUI 3 app.
1437
+
1438
+
:::image type="content" source="../../media/windows/create-a-new-winui-project.png" alt-text="Screenshot showing the New WinUI Project window within Visual Studio.":::
1439
+
1440
+
#### Install the package
1441
+
1442
+
Right click over your project and go to `Manage Nuget Packages` to install `Azure.Communication.Calling`[1.0.0-beta.33](https://www.nuget.org/packages/Azure.Communication.Calling/1.0.0-beta.33) or superior. Make sure Include Preleased is checked.
1443
+
1444
+
#### Request access
1445
+
1446
+
:::image type="content" source="../../media/windows/request-access.png" alt-text="Screenshot showing requesting access to Internet and Microphone in Visual Studio.":::
1447
+
1448
+
#### Set up the app framework
1449
+
1450
+
We need to configure a basic layout to attach our logic. In order to place an outbound call, we need a `TextBox` to provide the User ID of the callee. We also need a `Start Call` button and a `Hang Up` button.
1451
+
Open the `MainWindow.xaml` of your project and add the `Grid` node to your `Window`:
|`CallClient`| The `CallClient` is the main entry point to the Calling client library. |
1535
+
|`CallAgent`| The `CallAgent` is used to start and join calls. |
1536
+
|`Call`| The `Call` is used to manage placed or joined calls. |
1537
+
|`CommunicationTokenCredential`| The `CommunicationTokenCredential` is used as the token credential to instantiate the `CallAgent`.|
1538
+
|`CommunicationUserIdentifier`| The `CommunicationUserIdentifier` is used to represent the identity of the user, which can be one of the following options: `CommunicationUserIdentifier`, `PhoneNumberIdentifier` or `CallingApplication`. |
1539
+
1540
+
### Authenticate the client
1541
+
1542
+
Initialize a `CallAgent` instance with a User Access Token, which enables us to make and receive calls, and optionally obtain a DeviceManager instance to query for client device configurations.
1543
+
1544
+
In the following code, replace `<AUTHENTICATION_TOKEN>` with a User Access Token. Refer to the [user access token](../../../identity/access-tokens.md) documentation if you don't already have a token available.
1545
+
1546
+
Add the following code to the `InitCallAgentAndDeviceManagerAsync` function.
End the current call when the `Hang Up` button is clicked. Add the implementation to the HangupButton_Click to end a call with the callAgent we created, and tear down the call state event handler.
You can build and run the code on Visual Studio. For solution platforms, we support `ARM64`, `x64` and `x86`.
1602
+
1603
+
You can make an outbound call by providing a user ID in the text field and clicking the `Start Call` button. Calling `8:echo123` connects you with an echo bot, this feature is great for getting started and verifying your audio devices are working.
1604
+
1605
+
:::image type="content" source="../../media/windows/run-the-winui-app.png" alt-text="Screenshot showing running the WinUI quickstart app":::
0 commit comments