Azure Communication Services architecture design

This guide presents data flow diagrams for Azure Communication Services. Use these diagrams to understand how your clients and services interact with Azure to deliver communication experiences.

Communication Services is a cloud-based service with REST APIs and client library SDKs to help you integrate communication into your applications. Communication Services supports multiple communication formats: voice and video calling, text chat, SMS, and custom binary data.

You can add communication to web and mobile apps, integrate custom services and bots, and programmatically access the public switched telephony network (PSTN). You can acquire Communication Services direct routing, you can bring your own telephony provider via Session Initiation Protocol (SIP) and Session Border Controllers.

The following components are used in these data flow diagrams:

  • Client application. A website or native application used by end users for communication. Communication Services provides The open-source UI Library that's built on these SDKs provides programmable web (React), iOS, and Android UI components.
  • Identity management service. A service that you build to map users and services to Communication Services identities. This service also creates tokens for users when they need to access the data plane.
  • Communication controller service. A service that you build to control chat threads and voice and video calls.
  • Communication data service. A service capability that you build to directly interact with communication content, like sending chat and SMS messages or playing audio in a voice call.

Industry standards for communication, like WebRTC, separate communication into a control and signaling plane and a data plane. By using Communication Services, you can build a communication experience without needing to understand the service's internal implementation of WebRTC. These concepts can, however, help you design your app:

System Function Protocols Access model
Control plane Governs who communicates, when, and how REST User access tokens and Azure AD service credentials

A common data flow occurs when client applications initiate communication by requesting control information from a service controller:

  • What meetings do I have today?
  • What phone number do I use to call my friend Joseph?
  • What are the names of my teammates? What ongoing chat threads do we have?

Your control service fulfills these requests by providing clients with Communication Services tokens and identifiers for users, threads, phone numbers, and calls. Clients then use these tokens and identifiers to interact with the Azure data plane. Communication Services APIs don't constrain the design of your end-user experience or the processes that control communication.

In the WebRTC standard, clients request control information from services by sending control messages in a process known as signaling. Communication Services identifiers like call ID are comparable to WebRTC session descriptions.

Users authenticated via user access tokens

Communication Services clients present user access tokens to access, with improved security, the Azure calling and chat data plane. You should generate and manage user access tokens by using a trusted service. The token and the connection string or Azure Active Directory (Azure AD) secrets that are necessary to generate them need to be protected. Failure to properly manage access tokens can result in additional charges because of misuse of resources.

Diagram that shows the user access token architecture.

Download a Visio file of this architecture.

Dataflow

  1. A user starts the client application.
  2. The client application contacts your identity management service. The identity management service maintains a mapping between application identities and Communication Services identities. (Application identities include your users and other addressable objects, like services or bots.)
  3. The identity management service uses the mapping to issue a user access token for the applicable identity.

Azure App Service or Azure Functions are two alternatives for operating the identity management service. These services scale easily and have built-in features to Facebook.

Resources

User calls an app or phone number

The simplest voice and video calling scenario involves a user calling another user in the foreground without push notifications. You can integrate Communication Services voice and video calling into web, native mobile, and Windows desktop apps. The open-source UI Library can help you accelerate development.

Diagram that shows Communication Services calling without push notifications.

Download a Visio file of this architecture.

Dataflow

  1. The initiating user obtains the Communication Services identity of the person they want to call. In a typical scenario, the user gets the identity from a friends list that's maintained by the identity management service. The list collates the user's friends and associated Communication Services identities.
  2. The initiating user starts the Call client and calls the remote user.
  3. The accepting user is notified of the incoming call via the Calling SDK. To receive incoming calls, the acceptor must have already initialized the Call client.
  4. The users communicate with each other via voice and video in a call.

The dataflow is nearly identical when a user calls an external phone number. The key difference is that, to access traditional telephony, the initiating user client must request source and destination phone numbers from the controller service, instead of requesting user identities.

In some situations, you might want apps to accept calls in the background by using platform services like Apple Push Notification. You can enable this functionality by integrating Communication Services with Azure Notification Hubs.

Resources

User joins a group call without an invitation

You might want users to be able to join a group call without an explicit invitation. Your app might provide a persistent social space or club that includes a video calling channel that users can join when they want to. This dataflow shows a call that's initially created by a client and allows a remote client to join without explicit invitation:

SaleBestseller No. 1
HP Elite Desktop PC Computer Intel Core i5 3.1-GHz, 8 gb Ram, 1 TB Hard Drive, DVDRW, 19 Inch LCD Monitor, Keyboard, Mouse, Wireless WiFi, Windows 10 (Renewed)
  • This Certified Refurbished product is tested and...
  • HP Elite 6200 Small Form Factor Desktop PC, Intel...
  • Includes: USB Keyboard & Mouse, WiFi Adapter,...
  • Ports: USB 2.0, DisplayPort, VGA, PS/2 keyboard,...
  • Operating System: Windows 10 64 Bit –...
SaleBestseller No. 2
HP 2022 Newest All-in-One Desktop, 21.5" FHD Display, Intel Celeron J4025 Processor, 16GB RAM, 512GB PCIe SSD, Webcam, HDMI, RJ-45, Wired Keyboard&Mouse, WiFi, Windows 11 Home, White
  • 【High Speed RAM And Enormous Space】16GB DDR4...
  • 【Processor】Intel Celeron J4025 processor (2...
  • 【Display】21.5" diagonal FHD VA ZBD anti-glare...
  • 【Tech Specs】2 x SuperSpeed USB Type-A 5Gbps...
  • 【Authorized KKE Mousepad】Include KKE Mousepad

Diagram that shows a call without an invitation.

Download a Visio file of this architecture.

Dataflow

  1. The initiating user initializes the Call client and makes a group call.
  2. The initiating user shares the group call ID with a communication controller service.
  3. The communication controller service shares the call ID with other users. For example, if the application provides user clubs, the group call ID is an attribute of the club's data model that's stored in Azure Cosmos DB.
  4. Other users join the call by using the group call ID.
  5. Users communicate with each other via voice and video in a call.

Microsoft 365 and Teams

Many organizations use Microsoft 365 and Teams for communication. Communication Services and Teams are interoperable, which enables these scenarios:

  • Build a custom application to allow an external user to join a Teams meeting. This scenario is ideal for virtual visit scenarios, where a business that's using Teams hosts a meeting for external consumers who are using a custom app and a custom identity. To learn more about this scenario, see Virtual visits tutorial and Sample Builder.
  • Build a custom application for an internal user with Teams / Azure AD credentials. This scenario is designed for building custom Teams clients for employees.

These custom application scenarios use Microsoft Graph APIs and Communication Services. When you build external apps and services that connect to Teams, you generally use Microsoft Graph as the Teams control plane. You use this control plane to configure who communicates and how and when they communicate by using APIs for:

You use information from these control APIs, like the meeting URL and thread identifier, to connect Communication Services calling and chat clients to the Teams data plane.

Teams store, like tabs, bots, and automation. These scenarios are beyond the scope of this article.

Communication Services doesn't directly support interactions with Teams channels. For custom applications, you can use the Microsoft Graph Channel APIs to build custom clients for employees who access channels.

Application joins a scheduled Teams call

Communication Services applications can join Teams calls. For external users, the application needs a link to the Teams meeting. Link retrieval is managed via Microsoft Graph APIs. Here's the dataflow:

Diagram showing Communication Services architecture for joining a Teams meeting.

Download a Visio file of this architecture.

Dataflow

  1. (1A) The communication controller service schedules the group call by using the Microsoft Graph API. In another use case, (1B), users schedule the group call by using Outlook or Teams.
  2. The communication controller service shares the details of the Teams call with Communication Services clients.
  3. Typically, a Teams user must join the call via the Teams UI and allow external users to pass through the Teams pre-call lobby. However, this requirement depends on the configuration of the Teams tenant and the specific meeting settings.
  4. Communication Services users initialize the Call client and join the Teams meeting by using the details received in step 2.
  5. Users communicate with each other via voice and video.

Resources

Contributors

This article is maintained by Microsoft. It was originally written by the following contributors.

New
HP Stream 14 inch Laptop for Student and Business, Intel Quad-Core Processor, 16GB RAM, 64GB eMMC, 1-Year Office 365, Webcam, 12H Long Battery Life, Lightweight & Slim Laptop, Wi-Fi, Win 11 H in S
  • 【Processor】Intel Celeron N4120, 4 Cores & 4...
  • 【Display】14.0-inch diagonal, HD (1366 x 768),...
  • 【Storage】16GB high-bandwidth DDR4 Memory (2400...
  • 【Connectivity】1 x USB 3.1 Type-C ports, 2 x...
  • 【System】Windows 11 Home in S mode operating...
New
HAJAAN SuperX Gaming PC | Liquid Cooled | GeForce RTX 4060 8GB | AMD Ryzen 5 5600G | 32GB DDR4 | 1TB SSD | Windows 11 Pro | WiFi | Bluetooth - Black
  • Configured with AMD Ryzen 5 5600G Processor and...
  • 8GB GeForce RTX 4060 GDDR6 dedicated graphics card...
  • Liquid cooling system keeps internal components at...
  • Integrated PCIE Wi-Fi provides excellent wireless...
  • Includes USB Gaming RGB Mechanical Keyboard, Mouse...
New
Lenovo 2023 IdeaPad 1i Essential Laptop Computer, Intel Core i5-1235U 12th Gen, 15.6" FHD Anti-Glare Display, (16GB DDR4 RAM, 512GB SSD), HDMI, Bluetooth, Windows 11, Cloud Grey, W/GaLiMu
  • ✔【Display】 15.6" FHD (1920x1080) TN 220nits...
  • ✔【Memory & Storage】RAM Size 16GB 3200MHz...
  • ✔【Connectivity】 1x USB 2.0, 1x USB 3.2 Gen...
  • ✔【Processor & Graphics】 12th Generation...
  • ✔【Operating System】 Windows 11

Principal author:

Other contributors:

  • Mick Alberts | Technical Writer

To see non-public LinkedIn profiles, sign in to LinkedIn.

Next steps

https://docs.microsoft.com/en-us/azure/architecture/guide/mobile/azure-communication-services-architecture