Skip to content

Commit c2b3ef0

Browse files
authored
Merge pull request #290963 from yassirbisteni/yassirb/3955883-add-pre-call-diagnostics
Added docs for pre call diagnostics
2 parents 0d1b9ad + d817057 commit c2b3ef0

File tree

9 files changed

+476
-3
lines changed

9 files changed

+476
-3
lines changed

articles/communication-services/concepts/voice-video-calling/pre-call-diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.topic: conceptual
1111
ms.service: azure-communication-services
1212
---
1313

14-
# Pre-call diagnostic
14+
# Pre-call diagnostic overview
1515

1616
[!INCLUDE [Public Preview Disclaimer](../../includes/public-preview-include.md)]
1717

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Quickstart - Add pre-call diagnostics to your app
3+
titleSuffix: An Azure Communication Services quickstart
4+
description: This quickstart describes how to add pre-call diagnostics capabilities to your app using Azure Communication Services.
5+
author: yassirbisteni
6+
manager: bobgao
7+
ms.author: yassirb
8+
ms.date: 12/12/2024
9+
ms.topic: quickstart
10+
ms.service: azure-communication-services
11+
ms.subservice: calling
12+
zone_pivot_groups: acs-plat-web-windows-android-ios
13+
ms.custom: mode-other, devx-track-js
14+
---
15+
16+
# Quickstart: Add pre-call diagnostics to your app
17+
18+
::: zone pivot="platform-web"
19+
[!INCLUDE [Pre-call diagnostics with JavaScript](./includes/pre-call-diagnostics/pre-call-diagnostics-javascript.md)]
20+
::: zone-end
21+
22+
::: zone pivot="platform-windows"
23+
[!INCLUDE [Pre-call diagnostics with Windows](./includes/pre-call-diagnostics/pre-call-diagnostics-windows.md)]
24+
::: zone-end
25+
26+
::: zone pivot="platform-android"
27+
[!INCLUDE [Pre-call diagnostics with Android](./includes/pre-call-diagnostics/pre-call-diagnostics-android.md)]
28+
::: zone-end
29+
30+
::: zone pivot="platform-ios"
31+
[!INCLUDE [Pre-call diagnostics with iOS](./includes/pre-call-diagnostics/pre-call-diagnostics-ios.md)]
32+
::: zone-end
33+
34+
## Pricing
35+
36+
When the pre-call diagnostic test runs behind the scenes, it uses calling minutes to run the diagnostic. The test lasts for roughly 30 seconds, using up 30 seconds of calling time which is charged at the standard rate of $0.004 per participant per minute. For the case of pre-call diagnostics, the charge is for 1 participant x 30 seconds = $0.002.
37+
38+
## Next steps
39+
40+
- [Check your network condition with the diagnostics tool](../../concepts/developer-tools/network-diagnostic.md).
41+
- [Explore User-Facing Diagnostic APIs](../../concepts/voice-video-calling/user-facing-diagnostics.md).
42+
- [Enable Media Quality Statistics in your application](../../concepts/voice-video-calling/media-quality-sdk.md).
43+
- [Consume call logs with Azure Monitor](../../concepts/analytics/logs/voice-and-video-logs.md).
44+
45+
## Related articles
46+
47+
- Check out the [calling hero sample](../../samples/calling-hero-sample.md).
48+
- Get started with the [UI Library](../../concepts/ui-library/ui-library-overview.md).
49+
- Learn about [Calling SDK capabilities](./getting-started-with-calling.md?pivots=platform-web).
50+
- Learn more about [how calling works](../../concepts/voice-video-calling/about-call-types.md).

articles/communication-services/quickstarts/voice-video-calling/get-started-raw-media-access.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ ms.custom: mode-other, devx-track-js
3636

3737
## Next steps
3838

39-
For more information, see the following articles:
39+
- [Check your network condition with the diagnostics tool](../../concepts/developer-tools/network-diagnostic.md)
40+
- [Explore User-Facing Diagnostic APIs](../../concepts/voice-video-calling/user-facing-diagnostics.md)
41+
- [Enable Media Quality Statistics in your application](../../concepts/voice-video-calling/media-quality-sdk.md)
42+
- [Consume call logs with Azure Monitor](../../concepts/analytics/logs/voice-and-video-logs.md)
43+
44+
## Related articles
4045

4146
- Check out the [calling hero sample](../../samples/calling-hero-sample.md).
4247
- Get started with the [UI Library](../../concepts/ui-library/ui-library-overview.md).
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Azure Communication Services pre-call diagnostics
3+
titleSuffix: An Azure Communication Services concept document
4+
description: Overview of the pre-call diagnostic API feature.
5+
author: yassirbisteni
6+
manager: bobgao
7+
services: azure-communication-services
8+
ms.author: yassirb
9+
ms.date: 12/12/2024
10+
ms.topic: conceptual
11+
ms.service: azure-communication-services
12+
---
13+
14+
## Pre-call diagnostics
15+
16+
[!INCLUDE [Public Preview Disclaimer](../../../../includes/public-preview-include.md)]
17+
18+
The pre-call API feature allows developers to programmatically validate a client’s readiness to join an Azure Communication Services call. You can only access pre-call features using the Calling SDK. The pre-call diagnostic feature provides multiple diagnostics including device, connection, and call quality. Provide us with [feedback](../../../../support.md) about which platforms you want to see pre-call diagnostics enabled.
19+
20+
### Pre-call diagnostics access
21+
22+
To access pre-call diagnostics, you need to initialize a `CallClient`, and provision an Azure Communication Services access token. Then you can access the `PreCallDiagnostics` feature and the `startTest` method.
23+
24+
```java
25+
String acsToken = "";
26+
try
27+
{
28+
CommunicationTokenCredential credential = new CommunicationTokenCredential(acsToken);
29+
CallClient callClient = new CallClient();
30+
31+
PreCallDiagnosticsCallClientFeature preCallDiagnosticsFeature = callClient.feature(Features.PRE_CALL_DIAGNOSTICS);
32+
33+
preCallDiagnosticsFeature.addOnDiagnosticsReadyListener(this::OnPreCallDiagnosticsReady);
34+
preCallDiagnosticsFeature.startTest(context, credential);
35+
}
36+
catch (Exception ex) { }
37+
```
38+
39+
Once it finishes running, developers can access the result object.
40+
41+
### Diagnostic results
42+
43+
Pre-call diagnostics return a full diagnostic of the device including details like availability and compatibility, call quality statistics, and in-call diagnostics. The results are returned as a `PreCallDiagnosticsReadyEvent` object.
44+
45+
```java
46+
public void OnPreCallDiagnosticsReady(PreCallDiagnosticsReadyEvent args)
47+
{
48+
PreCallDiagnostics diagnostics = args.getDiagnostics();
49+
MediaStatisticsReport mediaStatsReport = diagnostics.getMediaStatisticsReport();
50+
51+
OutgoingMediaStatistics outgoingStatsList = mediaStatsReport.getOutgoingStatistics();
52+
if (outgoingStatsList != null)
53+
{
54+
List<OutgoingVideoStatistics> videoStatsList = outgoingStatsList.getVideoStatistics();
55+
List<OutgoingScreenShareStatistics> screenShareStatsList = outgoingStatsList.getScreenShareStatistics();
56+
List<OutgoingAudioStatistics> audioStatsList = outgoingStatsList.getAudioStatistics();
57+
}
58+
59+
IncomingMediaStatistics incomingStatsList = mediaStatsReport.getIncomingStatistics();
60+
if (incomingStatsList != null)
61+
{
62+
List<IncomingVideoStatistics> videoStatsList = incomingStatsList.getVideoStatistics();
63+
List<IncomingScreenShareStatistics> screenShareStatsList = incomingStatsList.getScreenShareStatistics();
64+
List<IncomingAudioStatistics> audioStatsList = incomingStatsList.getAudioStatistics();
65+
}
66+
}
67+
```
68+
69+
You can access individual result objects using the `PreCallDiagnosticsReadyEvent` type. Results for individual tests are returned when completed with many of the test results being available immediately. The results might take up to 1 minute as the test validates the quality of the video and audio.
70+
71+
### Device permissions
72+
73+
The permission check determines whether video and audio devices are available from a permissions perspective. Provides `boolean` value for `audio` and `video` devices.
74+
75+
```java
76+
List<DevicePermissionType> permissionList = preCallDiagnosticsFeature.getDevicePermissions(context);
77+
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Azure Communication Services pre-call diagnostics
3+
titleSuffix: An Azure Communication Services concept document
4+
description: Implement the pre-call diagnostic API feature.
5+
author: yassirbisteni
6+
manager: bobgao
7+
services: azure-communication-services
8+
ms.author: ybisteni
9+
ms.date: 11/11/2024
10+
ms.topic: conceptual
11+
ms.service: azure-communication-services
12+
---
13+
14+
## Implement pre-call diagnostics with iOS
15+
16+
[!INCLUDE [Public Preview Disclaimer](../../../../includes/public-preview-include.md)]
17+
18+
The pre-call API feature allows developers to programmatically validate a client’s readiness to join an Azure Communication Services call. You can only access pre-call features using the Calling SDK. The pre-call diagnostic feature provides multiple diagnostics including device, connection, and call quality. Provide us with [feedback](../../../../support.md) about which platforms you want to see pre-call diagnostics enabled.
19+
20+
### Pre-call diagnostics access
21+
22+
To access pre-call diagnostics, you need to initialize a `CallClient`, and provision an Azure Communication Services access token. Then you can access the `PreCallDiagnostics` feature and the `startTest` method.
23+
24+
```swift
25+
let acsToken: String;
26+
do
27+
{
28+
let options = CommunicationTokenRefreshOptions(initialToken: acsToken,
29+
refreshProactively: true,
30+
tokenRefresher: tokenRefresher)
31+
credentials = try CommunicationTokenCredential(withOptions: options)
32+
}
33+
catch
34+
{
35+
return nil
36+
}
37+
38+
let options = CallClientOptions()
39+
callClient = CallClient(options: options)
40+
41+
preCallDiagnosticsFeature = callClient.feature(Features.preCallDiagnostics)
42+
43+
preCallDiagnosticsCallClientFeatureObserver = PreCallDiagnosticsCallClientFeatureObserver(view: self)
44+
preCallDiagnosticsFeature.delegate = preCallDiagnosticsCallClientFeatureObserver
45+
preCallDiagnosticsFeature.startTest(credentials, withCompletionHandler: { error in
46+
47+
})
48+
49+
class PreCallDiagnosticsCallClientFeatureObserver: NSObject, PreCallDiagnosticsCallClientFeatureDelegate
50+
{
51+
private var view: HomeView
52+
53+
init(view: HomeView)
54+
{
55+
self.view = view
56+
}
57+
58+
func diagnosticsCallClientFeature(_ preCallDiagnosticsCallClientFeature: PreCallDiagnosticsCallClientFeature,
59+
didDiagnosticsReady args: PreCallDiagnosticsReadyEventArgs)
60+
{
61+
view.onPreCallDiagnosticsReady(args: args)
62+
}
63+
}
64+
```
65+
66+
Once it finishes running, developers can access the result object.
67+
68+
### Diagnostic results
69+
70+
Pre-call diagnostics returns a full diagnostic of the device including details like availability and compatibility, call quality statistics, and in-call diagnostics. The results are returned as a `PreCallDiagnosticsReadyEvent` object.
71+
72+
```swift
73+
func onPreCallDiagnosticsReady(args: PreCallDiagnosticsReadyEventArgs) -> Void
74+
{
75+
let diagnostics = args.diagnostics
76+
let mediaStatsReport = diagnostics.mediaStatisticsReport;
77+
78+
if let outgoingStatsList = mediaStatsReport.outgoingStatistics
79+
{
80+
let videoStatsList = outgoingStatsList.videoStatistics;
81+
let screenShareStatsList = outgoingStatsList.screenShareStatistics;
82+
let audioStatsList = outgoingStatsList.audioStatistics;
83+
}
84+
85+
if let incomingStatsList = mediaStatsReport.incomingStatistics
86+
{
87+
let videoStatsList = incomingStatsList.videoStatistics;
88+
let screenShareStatsList = incomingStatsList.screenShareStatistics;
89+
let audioStatsList = incomingStatsList.audioStatistics;
90+
}
91+
}
92+
```
93+
94+
You can access individual result objects using the `PreCallDiagnosticsReadyEvent` type. Results for individual tests are returned as they're completed with many of the test results being available immediately. The results might take up to 1 minute as the test validates the quality of the video and audio.
95+
96+
#### Device permissions
97+
98+
The permission check determines whether video and audio devices are available from a permissions perspective. Provides `boolean` value for `audio` and `video` devices.
99+
100+
```swift
101+
let permissionList = preCallDiagnosticsFeature?.devicePermissions()
102+
```

0 commit comments

Comments
 (0)