|
| 1 | +--- |
| 2 | +title: Developer Tools - Real-Time Inspection for Azure Communication Services |
| 3 | +description: Conceptual documentation outlining the capabilities provided by the Real-Time Inspection tool. |
| 4 | +author: ddematheu2 |
| 5 | +manager: chpalm |
| 6 | +services: azure-communication-services |
| 7 | + |
| 8 | +ms.author: dademath |
| 9 | +ms.date: 03/29/2022 |
| 10 | +ms.topic: conceptual |
| 11 | +ms.service: azure-communication-services |
| 12 | +--- |
| 13 | + |
| 14 | +# Real-time Inspection Tool for Azure Communication Services |
| 15 | + |
| 16 | +[!INCLUDE [Private Preview Disclaimer](../../includes/private-preview-include-section.md)] |
| 17 | + |
| 18 | +The Real-time Inspection Tool enables Azure Communication Services developers to inspect the state of the `Call` to debug or monitor their solution. For developers building an Azure Communication Services solution, they might need visibility for debugging into general call information such as the `Call ID` or advanced states, such as did a user facing diagnostic fire. The Real-time Inspection Tool provides developers this information and more. It can be easily added to any JavaScript (Web) solution by downloading the npm package `azure/communication-tools`. |
| 19 | + |
| 20 | +>[!NOTE] |
| 21 | +>Find the open-source repository for the tool [here](https://github.com/Azure/communication-inspection). |
| 22 | +
|
| 23 | +## Capabilities |
| 24 | + |
| 25 | +The Real-time Inspection Tool provides developers three categories of information that can be used for debugging purposes: |
| 26 | + |
| 27 | +| Category | Descriptions | |
| 28 | +|--------------------------------|-----------------------------------| |
| 29 | +| General Call Information | Includes call id, participants, devices and user agent information (browser, version, etc.) | |
| 30 | +| Media Quality Stats | Metrics and statistics provided by [Media Quality APIs](../voice-video-calling/media-quality-sdk.md). Metrics are clickable for time series view.| |
| 31 | +| User Facing Diagnostics | List of [user facing diagnostics](../voice-video-calling/user-facing-diagnostics.md).| |
| 32 | + |
| 33 | +Data collected by the tool is only kept locally and temporarily. It can be downloaded from within the interface. |
| 34 | + |
| 35 | +Real-time Inspection Tool is compatible with the same browsers as the Calling SDK [here](../voice-video-calling/calling-sdk-features.md?msclkid=f9cf66e6a6de11ec977ae3f6d266ba8d#javascript-calling-sdk-support-by-os-and-browser). |
| 36 | + |
| 37 | +## Get started with Real-time Inspection Tool |
| 38 | + |
| 39 | +The tool can be accessed through an npm package `azure/communication-inspection`. The package contains the `InspectionTool` object that can be attached to a `Call`. The Call Inspector requires an `HTMLDivElement` as part of its constructor on which it will be rendered. The `HTMLDivElement` will dictate the size of the Call Inspector. |
| 40 | + |
| 41 | +### Installing Real-time Inspection Tool |
| 42 | + |
| 43 | +```bash |
| 44 | +npm i @azure/communication-inspection |
| 45 | +``` |
| 46 | + |
| 47 | +### Initialize Real-time Inspection Tool |
| 48 | + |
| 49 | +```javascript |
| 50 | +import { CallClient, CallAgent } from "@azure/communication-calling"; |
| 51 | +import { InspectionTool } from "@azure/communication-tools"; |
| 52 | + |
| 53 | +const callClient = new callClient(); |
| 54 | +const callAgent = await callClient.createCallAgent({INSERT TOKEN CREDENTIAL}); |
| 55 | +const call = callAgent.startCall({INSERT CALL INFORMATION}); |
| 56 | + |
| 57 | +const inspectionTool = new InspectionTool(call, {HTMLDivElement}); |
| 58 | + |
| 59 | +``` |
| 60 | +## Usage |
| 61 | + |
| 62 | +`start`: enable the `InspectionTool` to start reading data from the call object and storing it locally for visualization. |
| 63 | + |
| 64 | +```javascript |
| 65 | + |
| 66 | +inspectionTool.start() |
| 67 | + |
| 68 | +``` |
| 69 | + |
| 70 | +`stop`: disable the `InspectionTool` from reading data from the call object. |
| 71 | + |
| 72 | +```javascript |
| 73 | + |
| 74 | +inspectionTool.stop() |
| 75 | + |
| 76 | +``` |
| 77 | + |
| 78 | +`open`: Open the `InspectionTool` in the UI. |
| 79 | + |
| 80 | +```javascript |
| 81 | + |
| 82 | +inspectionTool.open() |
| 83 | + |
| 84 | +``` |
| 85 | + |
| 86 | +`close`: Dismiss the `InspectionTool` in the UI. |
| 87 | + |
| 88 | +```javascript |
| 89 | + |
| 90 | +inspectionTool.close() |
| 91 | + |
| 92 | +``` |
| 93 | + |
| 94 | +## Next Steps |
| 95 | + |
| 96 | +- [Explore User-Facing Diagnostic APIs](../voice-video-calling/user-facing-diagnostics.md) |
| 97 | +- [Enable Media Quality Statistics in your application](../voice-video-calling/media-quality-sdk.md) |
| 98 | +- [Leverage Network Diagnostic Tool](./network-diagnostic.md) |
| 99 | +- [Consume call logs with Azure Monitor](../analytics/call-logs-azure-monitor.md) |
0 commit comments