Skip to content

Commit 38544d9

Browse files
authored
Merge pull request #214087 from ddematheu2/patch-32
Update pre-call-diagnostics.md
2 parents 3d0719b + 820df13 commit 38544d9

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

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

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,36 @@ ms.service: azure-communication-services
1414

1515
# Pre-Call diagnostic
1616

17-
[!INCLUDE [Private Preview Disclaimer](../../includes/private-preview-include-section.md)]
17+
[!INCLUDE [Public Preview Disclaimer](../../includes/public-preview-include.md)]
1818

1919
The Pre-Call API enables developers to programmatically validate a client’s readiness to join an Azure Communication Services Call. The Pre-Call APIs can be accessed through the Calling SDK. They provide multiple diagnostics including device, connection, and call quality. Pre-Call APIs are available only for Web (JavaScript). We will be enabling these capabilities across platforms in the future, please provide us feedback on what platforms you would like to see Pre-Call APIs on.
2020

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+
- [Node.js](https://nodejs.org/) active Long Term Support(LTS) versions are recommended.
25+
- An active Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
26+
- A User Access Token to instantiate the call client. Learn how to [create and manage user access tokens](../../quickstarts/access-tokens.md). You can also use the Azure CLI and run the command below with your connection string to create a user and an access token. (Need to grab connection string from the resource through Azure portal.)
27+
28+
```azurecli-interactive
29+
az communication identity token issue --scope voip --connection-string "yourConnectionString"
30+
```
31+
32+
For details, see [Use Azure CLI to Create and Manage Access Tokens](../../quickstarts/access-tokens.md?pivots=platform-azcli).
33+
2134
## Accessing Pre-Call APIs
2235

2336
>[!IMPORTANT]
24-
>Pre-Call diagnostics are available starting on the version [1.5.2-alpha.20220415.1](https://www.npmjs.com/package/@azure/communication-calling/v/1.5.2-alpha.20220415.1) of the Calling SDK. Make sure to use that version when trying the instructions below.
37+
>Pre-Call diagnostics are available starting on the version [1.9.1-beta.1](https://www.npmjs.com/package/@azure/communication-calling/v/1.9.1-beta.1) of the Calling SDK. Make sure to use that version when trying the instructions below.
2538
2639
To Access the Pre-Call API, you will need to initialize a `callClient` and provision an Azure Communication Services access token. There you can access the `PreCallDiagnostics` feature and the `startTest` method.
2740

2841
```javascript
2942
import { CallClient, Features} from "@azure/communication-calling";
3043
import { AzureCommunicationTokenCredential } from '@azure/communication-common';
3144

32-
const tokenCredential = new AzureCommunicationTokenCredential();
45+
const callClient = new CallClient();
46+
const tokenCredential = new AzureCommunicationTokenCredential("INSERT ACCESS TOKEN");
3347
const preCallDiagnosticsResult = await callClient.feature(Features.PreCallDiagnostics).startTest(tokenCredential);
3448

3549
```
@@ -109,6 +123,7 @@ Performs a quick call to check in-call metrics for audio and video and provides
109123

110124
InCall diagnostics leverages [media quality stats](./media-quality-sdk.md) to calculate quality scores and diagnose issues. During the pre-call diagnostic, the full set of media quality stats are available for consumption. These will include raw values across video and audio metrics that can be used programatically. The InCall diagnostic provides a convenience layer on top of media quality stats to consume the results without the need to process all the raw data. See section on media stats for instructions to access.
111125

126+
112127
```javascript
113128

114129
const inCallDiagnostics = await preCallDiagnosticsResult.inCallDiagnostics;
@@ -121,17 +136,28 @@ InCall diagnostics leverages [media quality stats](./media-quality-sdk.md) to ca
121136

122137
```
123138

124-
At this step, there are multiple failure points to watch out for:
139+
At this step, there are multiple failure points to watch out for. The values provided by the API are based on the threshold values required by the service. Those raw thresholds can be found in our [media quality stats documentation](./media-quality-sdk.md#best-practices).
125140

126141
- If connection fails, the user should be prompted to recheck their network connectivity. Connection failures can also be attributed to network conditions like DNS, Proxies or Firewalls. For more information on recommended network setting check out our [documentation](network-requirements.md).
127142
- If bandwidth is `Bad`, the user should be prompted to try out a different network or verify the bandwidth availability on their current one. Ensure no other high bandwidth activities might be taking place.
128143

129144
### Media stats
130145
For granular stats on quality metrics like jitter, packet loss, rtt, etc. `callMediaStatistics` are provided as part of the `preCallDiagnosticsResult` feature. See the [full list and description of the available metrics](./media-quality-sdk.md) in the linked article. You can subscribe to the call media stats to get full collection of them. This is the raw metrics that are used to calculate InCall diagnostic results and which can be consumed granularly for further analysis.
131146

147+
```javascript
148+
149+
const mediaStatsCollector = callMediaStatistics.startCollector();
150+
151+
mediaStatsCollector.on('mediaStatsEmitted', (mediaStats: SDK.MediaStats) => {
152+
// process the stats for the call.
153+
console.log(mediaStats);
154+
});
155+
156+
```
157+
132158
## Pricing
133159

134-
When the Pre-Call diagnostic test runs, behind the scenes it uses calling minutes to run the diagnostic. The test lasts for roughly 1 minute, using up 1 minute of calling which is charged at the standard rate of $0.004 per participant per minute. For the case of Pre-Call diagnostic, the charge will be for 1 participant x 1 minutes = $0.004.
160+
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 which is charged at the standard rate of $0.004 per participant per minute. For the case of Pre-Call diagnostic, the charge will be for 1 participant x 30 seconds = $0.002.
135161

136162
## Next steps
137163

0 commit comments

Comments
 (0)