Extend precall activities
A successful Virtual appointment experience requires the device to be prepared for the audio and video experience. Azure Communication Services provides a set of tools that help to validate the device prerequisites before the Virtual appointment guided support.
Prerequisites
The reader of this article is expected to have a solid understanding of the following topics:
- Microsoft Teams Virtual appointments product and provided user experience
- Microsoft Graph Booking API to manage Microsoft Booking via Microsoft Graph API
- Microsoft Graph Online meeting API to manage Microsoft Teams meetings via Microsoft Graph API
- Azure Communication Services Chat, Calling and user interface library
Background validation
Azure Communication Services provides precall diagnostic APIs for validating device readiness, such as browser compatibility, network, and call quality. The following code snippet runs a 30-second test on the device.
Create CallClient and get PreCallDiagnostics feature:
const callClient = new CallClient();
const preCallDiagnostics = callClient.feature(Features.PreCallDiagnostics);
Start precall test with an access token:
const tokenCredential = new AzureCommunicationTokenCredential("<ACCESS_TOKEN>");
const preCallDiagnosticsResult = await preCallDiagnostics.startTest(tokenCredential);
Review the diagnostic results to determine if the device is ready for the Virtual appointment. Here's an example of how to validate readiness for browser and operating system support:
const browserSupport = await preCallDiagnosticsResult.browserSupport;
if(browserSupport) {
console.log(browserSupport.browser) // "Supported" | "NotSupported" | "Unknown"
console.log(browserSupport.os) // "Supported" | "NotSupported" | "Unknown"
}
Additionally, you can validate MediaStatsCallFeature, DeviceCompatibility, DeviceAccess, DeviceEnumeration, InCallDiagnostics . You can also look at the tutorial that implements pre-call diagnostics with a user interface library.
Azure Communication Services has a ready-to-use tool called Network Diagnostics for developers to ensure that their device and network conditions are optimal for connecting to the service.
Guided validation
Azure Communication Services has a dedicated bot for validating client's audio settings. The bot plays a prerecorded message and prompts the customer to record their own message. With proper microphone and speaker settings, customers can hear both the prerecorded message and their own recorded message played back to them.
Use the following code snippet to start the call to test the bot
const callClient = new CallClient();
const tokenCredential = new AzureCommunicationTokenCredential("<ACCESS_TOKEN>");
callAgent = await callClient.createCallAgent(tokenCredential, {displayName: 'Adele Vance'})
call = callAgent.startCall([{id: '8:echo123'}],{});
Next steps
- Learn what extensibility options do you have for Virtual appointments.
- Learn how to customize scheduling experience
- Learn how to customize before and after appointment
- Learn how to customize call experience