Skip to content

Commit c923f81

Browse files
committed
data channel and proxy
1 parent b8b6f64 commit c923f81

File tree

13 files changed

+237
-133
lines changed

13 files changed

+237
-133
lines changed

articles/communication-services/concepts/voice-video-calling/data-channel.md

Lines changed: 33 additions & 23 deletions
Large diffs are not rendered by default.

articles/communication-services/how-tos/calling-sdk/call-context.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
11
---
2-
title: How to pass contextual data between calls
3-
titleSuffix: An Azure Communication Services how-to guide
2+
title: Pass user-to-user information (UUI) data in a header
3+
titleSuffix: An Azure Communication Services article
44
description: Use Azure Communication Services SDKs to pass contextual data between calls.
55
author: sloanster
66
ms.author: micahvivion
77
ms.service: azure-communication-services
88
ms.subservice: calling
99
ms.topic: how-to
10-
ms.date: 09/13/2024
10+
ms.date: 06/27/2025
1111
ms.custom: template-how-to
1212
---
1313

14-
# Using the ACS calling SDK to pass contextual User-to-User Information (UUI) data between calls
14+
# Pass user-to-user information (UUI) data in a header
1515

16-
In this article, you learn how to pass along custom contextual information when routing calls with Azure Communication Services Calling SDKs. This capability allows users to pass metadata about the call, callee, or any other information that is relevant to their application or business logic.
16+
This article describes how to pass user-to-user information (UUI) in a header when routing calls with Azure Communication Services Calling SDKs. This capability enables users to pass metadata about the call, callee, or any other information that is relevant to their application or business logic.
1717

18-
The Azure Communication Services (ACS) WebJS SDK provides developers to include custom contextual data (included as a header on the calling object) when directing and routing calls from one person to another. This information, also known as User-to-User Information (UUI) data or call control UUI data, is a small piece of data inserted by an application initiating the call. The UUI data is opaque to end users making a call.
18+
The Azure Communication Services WebJS SDK enables developers to include custom contextual data (included as a header on the calling object) when directing and routing calls from one person to another. This information, also known as user-to-user information (UUI) data or call control UUI data, is a small piece of data inserted by an application initiating the call. The UUI data is opaque to end users making a call.
1919

20-
Contextual information supported includes both freeform custom headers and the standard User-to-User Information (UUI) SIP header. Also when you receive an inbound call, the custom headers and UUI are included in the incomingCall payload.
20+
Contextual information supported includes both freeform custom headers and the standard UUI SIP header. In addition, when you receive an inbound call, the custom headers and UUI are included in the `incomingCall` payload.
2121

2222
All custom context data is opaque to Calling SDK or SIP protocols and its content is unrelated to any basic functions.
2323

24-
Developers can pass this context by using custom headers, which consist of optional key-value pairs. These pairs can be included in the 'AddParticipant' or 'Transfer' actions within the calling SDK. Once added, you can read the data payload as the call moves between endpoints. By efficiently looking up this metadata and associating it with the call, developers can avoid external database lookups and have the content information readily available within the call object.
24+
Developers can pass this context by using custom headers, which consist of optional key-value pairs. These pairs can be included in the `AddParticipant` or `Transfer` actions within the calling SDK. Once added, you can read the data payload as the call moves between endpoints. By efficiently looking up this metadata and associating it with the call, developers can avoid external database lookups and have the content information readily available within the call object.
2525

26-
The custom call context can be transmitted to SIP endpoints using the SIP protocol. This transmission includes both the custom headers and the standard User-to-User Information (UUI) SIP header. When an inbound call is routed from your telephony network, the data from your Session Border Controller (SBC) in the custom headers and UUI is also included in the IncomingCall event payload.
26+
The custom call context can be transmitted to SIP endpoints using the SIP protocol. This transmission includes both the custom headers and the standard UUI SIP header. When an inbound call is routed from your telephony network, the data from your Session Border Controller (SBC) in the custom headers and UUI is also included in the IncomingCall event payload.
2727

2828
It’s important to note that all custom context data remains transparent to the calling SDK and isn't related to any of the SDK’s fundamental functions when used in SIP protocols. Here's a tutorial to assist you in adding custom context headers when using the WebJS SDK.
2929

3030

3131
> [!IMPORTANT]
32-
> To use the ability to pass User-to-User Information (UUI) data using the calling SDK you must use the calling WebJS SDK GA or public preview version `1.29.1` or later.
32+
> To pass UUI data using the calling SDK, you must use the calling WebJS SDK GA or public preview version `1.29.1` or later.
3333
3434
[!INCLUDE [Passing Contextual Data - Client-side JavaScript](./includes/call-context/call-context-web.md)]
3535

3636
## Next steps
37+
3738
- [Learn how to manage calls](./manage-calls.md)
3839
- [Learn how to manage video](./manage-video.md)
3940
- [Learn how to record calls](./record-calls.md)

articles/communication-services/how-tos/calling-sdk/includes/call-context/call-context-web.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
author: sloanster
33
ms.service: azure-communication-services
44
ms.topic: include
5-
ms.date: 09/13/2024
5+
ms.date: 06/27/2025
66
ms.author: micahvivion
77
---
88

9-
109
## Technical parameters
11-
The calling SDK supports adding up to 5 custom SIP headers and 1000 custom VOIP headers. Additionally, developers can include a dedicated User-To-User header as part of SIP headers list.
1210

13-
The maximum length of a SIP header key is 64 chars, including the X-MS-Custom prefix. Due note that when the SIP header is added the calling SDK will automatically add the ‘X-MS-Custom-’ prefix (which can be seeing if you inspect the SIP header with packet inspector).
11+
The calling SDK supports adding up to five (5) custom SIP headers and 1000 custom VOIP headers. Additionally, developers can include a dedicated User-To-User header as part of SIP headers list.
12+
13+
The maximum length of a SIP header key is 64 chars, including the X-MS-Custom prefix. When you add the SIP header to the calling SDK, it automatically adds the `X-MS-Custom-` prefix, which you can see by inspecting the SIP header with packet inspector.
1414

15-
The SIP header key may consist of alphanumeric characters and a few selected symbols which include `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`. The maximum length of SIP header value is 256 chars. The same limitations apply when configuring the SIP headers on your SBC. The SIP header value may consist of alphanumeric characters and a few selected symbols which include `=`, `;`, `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`.
15+
The SIP header key might consist of alphanumeric characters and a few selected symbols, which include `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`. The maximum length of SIP header value is 256 chars. The same limitations apply when configuring the SIP headers on your session border controller (SBC). The SIP header value might consist of alphanumeric characters and a few selected symbols, which include `=`, `;`, `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`.
1616

17-
The maximum length of a VOIP header key is 64 chars. The maximum length of VOIP header value is 1024 chars.
17+
The maximum length of a VOIP header key is 64 chars. The maximum length of VOIP header value is 1024 characters.
1818

1919
When adding these custom headers as a developer you can choose to add only SIP headers, only VoIP headers or both can be included.
2020

2121
> [!NOTE]
22-
> Currently, adding custom User-to-User Information headers is only supported when initiating a 1:1 call. Passing User-to-User Information headers in group calls is not currently supported. To work around this after starting the 1:1 call, you can include additional participants while maintaining the User-to-User Information within the calls.
22+
> Currently, adding custom User-to-User Information headers is only supported when initiating a 1:1 call. Passing User-to-User Information headers in group calls isn't currently supported. To work around this constraint after starting the 1:1 call, you can add participants while maintaining the User-to-User Information within the calls.
2323
24-
For details on the custom context interface API, consult the [custom context API resource](/javascript/api/azure-communication-services/@azure/communication-calling/customcontext?view=azure-communication-services-js&preserve-view=true) page.
24+
For details about the custom context interface API, see [custom context API resource](/javascript/api/azure-communication-services/@azure/communication-calling/customcontext?view=azure-communication-services-js&preserve-view=true).
2525

2626
## Place a call with User-to-User Information (UUI) data
2727

articles/communication-services/quickstarts/voice-video-calling/get-started-data-channel.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
ms.author: enricohuang
3-
title: Quickstart - Add Data Channel messaging to your calling app
4-
titleSuffix: An Azure Communication Services quickstart
5-
description: In this quickstart, you'll learn how to add Data Channel to your existing calling app using Azure Communication Services.
2+
title: Add data channel messaging to a calling app
3+
titleSuffix: An Azure Communication Services article
4+
description: This article describes how to add Data Channel to your existing calling app using Azure Communication Services.
65
author: sloanster
6+
ms.author: enricohuang
77
services: azure-communication-services
8-
ms.date: 05/04/2023
8+
ms.date: 6/27/2025
99
ms.topic: quickstart
1010
ms.service: azure-communication-services
1111
ms.subservice: calling
1212
zone_pivot_groups: acs-plat-web-ios-android-windows
1313
ms.custom: mode-other, devx-track-js
1414
---
1515

16-
# Quickstart: Add Data Channel messaging to your calling app
16+
# Add data channel messaging to a calling app
1717

1818
::: zone pivot="platform-web"
1919
[!INCLUDE [Data Channel feature with JavaScript](./includes/data-channel/data-channel-javascript.md)]
@@ -33,7 +33,7 @@ ms.custom: mode-other, devx-track-js
3333

3434
## Next steps
3535

36-
For more information, see the following articles:
36+
For more information, see:
3737

38-
- Learn about [Data Channel feature concept document](../../concepts/voice-video-calling/data-channel.md)
39-
- Learn more about [Calling SDK capabilities](./getting-started-with-calling.md)
38+
- [Data Channel feature concept document](../../concepts/voice-video-calling/data-channel.md)
39+
- [Calling SDK capabilities](./getting-started-with-calling.md)

articles/communication-services/quickstarts/voice-video-calling/includes/data-channel/data-channel-android.md

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,70 @@
11
---
2+
title: Add data channel messaging to a calling app
3+
titleSuffix: An Azure Communication Services article
4+
description: This article describes how to add Data Channel to your existing calling app using Azure Communication Services.
25
ms.author: chengyuanlai
3-
title: Quickstart - Add data channel to your Android calling app
4-
titleSuffix: An Azure Communication Services document
5-
description: In this quickstart, you learn how to add data channel messaging to your existing Android calling app using Azure Communication Services.
66
author: sloanster
77
services: azure-communication-services
8-
ms.date: 03/01/2024
8+
ms.date: 06/27/2025
99
ms.topic: include
1010
ms.service: azure-communication-services
1111
ms.subservice: calling
1212
---
1313

1414
>[!IMPORTANT]
15-
> Please be aware that the current Data Channel feature API doesn't support direct messaging between a web browser and a native app in a peer-to-peer call scenario.
15+
> The current Data Channel feature API doesn't support direct messaging between a web browser and a native app in a peer-to-peer call scenario.
1616
1717
## Overview
18+
1819
The Data Channel feature API enables real-time data messaging during audio and video calls. In this quickstart guide, we illustrate how to integrate Data Channel feature to your call and use the Data Channel APIs to send and receive data messages through a data channel.
20+
1921
### Prerequisites
22+
2023
Refer to the [Voice Calling Quickstart](../../getting-started-with-calling.md?pivots=platform-android) to set up a sample app with voice calling.
24+
2125
### Classes
26+
2227
| Name | Description |
23-
| - | - |
28+
| --- | --- |
2429
| DataChannelCallFeature | Used to start and manage data channel feature. |
2530
| DataChannelSender | Used to manage a data channel as a sender and send data. |
2631
| DataChannelReceiver | Used to manage a data channel as a receiver and receive data. |
2732
| DataChannelSenderOptions | Used for representing options to create a data channel sender. |
33+
2834
### Enums
35+
2936
| Name | Description |
30-
| - | - |
37+
| --- | --- |
3138
| DataChannelPriority | Describes the priority options of data channel. Values: { `NORMAL`, `HIGH` }. |
3239
| DataChannelReliability | Describes the reliability options of data channel. Values: { `LOSSY`, `DURABLE` }. |
40+
3341
### Error Code
42+
3443
| Name | Description |
35-
| - | - |
36-
| _DATA_CHANNEL_FAILED_TO_START_ | `getDataChannelSender()` can fail with this error code, indicating underlying Data Channel is not ready to be used. |
37-
| _DATA_CHANNEL_RANDOM_ID_NOT_AVAILABLE_ | `getDataChannelSender()` can fail with this error code, indicating all available random channel IDs have already been used. |
38-
| _DATA_CHANNEL_SENDER_CLOSED_ | `sendMessage()` can fail with this error code, indicating the sender has already been closed previously. |
44+
| --- | --- |
45+
| _DATA_CHANNEL_FAILED_TO_START_ | `getDataChannelSender()` can fail with this error code, indicating underlying Data Channel isn't ready to be used. |
46+
| _DATA_CHANNEL_RANDOM_ID_NOT_AVAILABLE_ | `getDataChannelSender()` can fail with this error code, indicating each available random channel ID is in use. |
47+
| _DATA_CHANNEL_SENDER_CLOSED_ | `sendMessage()` can fail with this error code, indicating the sender data channel is already closed. |
3948
| _DATA_CHANNEL_MESSAGE_SIZE_OVER_LIMIT_ | `sendMessage()` can fail with this error code, indicating the message data size exceeds the limit. You can get the message size limit using `getMaxMessageSizeInBytes()` in `DataChannelSender`. |
4049
| _DATA_CHANNEL_MESSAGE_FAILURE_FOR_BANDWIDTH_ | `sendMessage()` can fail with this error code, indicating a failure in sending the message due to not enough bandwidth. |
4150
| _DATA_CHANNEL_MESSAGE_FAILURE_FOR_TRAFFIC_LIMIT_ | `sendMessage()` can fail with this error code, indicating a failure in sending the message due to the overall usage of Data Channel not in compliance with the traffic limit rules. Refer to [Data Channel Concept Document](../../../../concepts/voice-video-calling/data-channel.md) for details of the traffic limit. |
51+
4252
### Methods
53+
4354
#### Enable Data Channel feature
4455

4556
1. Get the ongoing call object established during the prerequisite steps.
57+
4658
2. Get the Data Channel Feature object.
59+
4760
```java
4861
DataChannelCallFeature dataChannelCallFeature = call.feature(Features.DATA_CHANNEL);
4962
```
63+
5064
#### Receiving data message
65+
5166
1. Define the DataChannelReceiverCreatedListener.
67+
5268
```java
5369
DataChannelReceiverCreatedListener receiverCreatedListener = new DataChannelReceiverCreatedListener() {
5470
@Override
@@ -62,11 +78,15 @@ DataChannelReceiverCreatedListener receiverCreatedListener = new DataChannelRece
6278
}
6379
};
6480
```
81+
6582
2. Register the `receiverCreatedListener`.
83+
6684
```java
6785
dataChannelCallFeature.addOnReceiverCreatedListener(receiverCreatedListener);
6886
```
87+
6988
3. Define the MessageReceivedListener.
89+
7090
```java
7191
MessageReceivedListener messageReceivedListener = new MessageReceivedListener() {
7292
@Override
@@ -77,7 +97,9 @@ MessageReceivedListener messageReceivedListener = new MessageReceivedListener()
7797
}
7898
};
7999
```
80-
4. Define the ReceiverClosedListener.
100+
101+
4. Define the `ReceiverClosedListener`.
102+
81103
```java
82104
ReceiverClosedListener receiverClosedListener = new ReceiverClosedListener() {
83105
@Override
@@ -86,13 +108,18 @@ ReceiverClosedListener receiverClosedListener = new ReceiverClosedListener() {
86108
}
87109
};
88110
```
111+
89112
5. Register the `messageReceivedListener` and `receiverClosedListener`.
113+
90114
```java
91115
receiver.addOnMessageReceivedListener(messageReceivedlistener);
92116
receiver.addOnClosedListener(receiverClosedListener);
93117
```
118+
94119
#### Sending data message
95-
1. Configure the DataChannelSenderOptions.
120+
121+
1. Configure the `DataChannelSenderOptions`.
122+
96123
```java
97124
DataChannelSenderOptions options = new DataChannelSenderOptions();
98125
options.setChannelId(1000);
@@ -103,7 +130,9 @@ options.setReliability(DataChannelReliability.LOSSY);
103130
List<CommunicationIdentifier> participants = Arrays.asList( /* identifier1, identifier2, ... */ );
104131
options.setParticipants(participants);
105132
```
106-
2. Get the DataChannelSender and send data message
133+
134+
2. Get the `DataChannelSender` and send data message.
135+
107136
```java
108137
DataChannelSender dataChannelSender = dataChannelCallFeature.getDataChannelSender(options);
109138

0 commit comments

Comments
 (0)