Skip to content

Commit 9ac743b

Browse files
authored
added more data
1 parent ccab0af commit 9ac743b

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

articles/communication-services/tutorials/calling-sdk/tutorials/pass-contextual-data-header.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
11
---
2-
title: Tutorial on how to pass call contextual data information using your Azure Communication Services WebJS SDK
2+
title: Tutorial on how to pass User-to-User Information (UUI) data using your Azure Communication Services WebJS SDK
33
titleSuffix: An Azure Communication Services tutorial document
4-
description: Provide a tutorial on how to pass contextual information using calling SDK
4+
description: Provide a tutorial on how to pass contextual User-to-User Information (UUI) information using calling SDK
55
author: sloanster
66
ms.topic: tutorial
77
ms.service: azure-communication-services
8-
ms.date: 09/10/2024
8+
ms.date: 09/11/2024
99
ms.author: micahvivion
1010
services: azure-communication-services
1111
---
1212

13-
# Using the ACS calling SDK to pass contextual data between calls
13+
# Using the ACS calling SDK to pass contextual User-to-User Information (UUI) data between calls
1414

15-
The Azure Communication Services (ACS) WebJS SDK provide the ability to allow developers to include custom contextual data (included as a header on the calllin object) when directing and routing calls from one person to another. This functionality allows for the inclusion of metadata related to the call, the recipient, or any other pertinent information that aligns with the application’s needs or the company’s operational logic.
15+
The Azure Communication Services (ACS) WebJS SDK provide the ability to allow developers to include custom contextual data (included as a header on the calllin object) when directing and routing calls from one person to another. This informaiton, 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 This UUI data is opaque to SIP and its
1616

1717
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.
1818

19-
Moreover, the custom call context can also also transmitted to to SIP endpoings using 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.
19+
Moreover, the custom call context can also also transmitted to to SIP endpoints using 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.
2020

21-
It’s important to note that all custom context data remains transparent to the calling SDK and is not related to any of the SDK’s fundamental functions when used in SIP protocols. Here is a tutorial to assist you in implementing custom context headers using the WebJS SDK.
21+
It’s important to note that all custom context data remains transparent to the calling SDK and is not related to any of the SDK’s fundamental functions when used in SIP protocols. Here is a tutorial to assist you in adding custom context headers when using the WebJS SDK.
22+
23+
[!INCLUDE [Public Preview Disclaimer](../../../includes/public-preview-include.md)]
24+
25+
> [!IMPORTANT]
26+
> To use the ability to pass User-to-User Information (UUI) data using the calling SDK you must use the public preview calling SDK version `1.29.1` or later.
2227
2328
## Technical parameters
24-
The calling SDK support 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.
29+
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.
30+
31+
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 ‘X-MS-Custom-’ prefix (which can be seeing if you insspect the SIP header with packet inspector).
32+
33+
The SIP header key may consist of alphanumeric characters and a few selected symbols which includes `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`. 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 includes `=`, `;`, `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`.
2534

26-
The custom SIP header key must start with a mandatory ‘X-MS-Custom-’ prefix. The maximum length of a SIP header key is 64 chars, including the X-MS-Custom prefix. The SIP header key may consist of alphanumeric characters and a few selected symbols which includes `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`. 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 includes `=`, `;`, `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`.
35+
The maximum length of a VOIP header key is 64 chars. The maximum length of VOIP header value is 1024 chars.
2736

28-
The maximum length of a VOIP header key is 64 chars. These headers can be sent without ‘x-MS-Custom’ prefix. The maximum length of VOIP header value is 1024 chars.
37+
When adding these custom headers as a developer you can choose to add only SIP headers, only VoIP headers or both can be included.
2938

3039
## Adding custom context when inviting a participant
3140

3241
### Adding custom context headings using the WebJS calling SDK
3342

3443
```js
35-
3644
const callOptions = {
3745
customContext: {
3846
voipHeaders: [
3947
{key: 'voip-key-1', value: 'voip-value-1'},
4048
{key: 'voip-key-2', value: 'voip-value-2'}
4149
],
42-
// Sip headers have a max limit of 5 headers.
43-
// SDK is prefixing them with 'x-ms-client-' to avoid conflicts with existing headers.
4450
sipHeaders: [
4551
{key: 'sip-key-1', value: 'sip-value-1'},
4652
{key: 'sip-key-2', value: 'sip-value-2'}
@@ -49,8 +55,7 @@ The maximum length of a VOIP header key is 64 chars. These headers can be sent w
4955
},
5056
};
5157

52-
// you can specify only sipHeaders or voipHeaders or both.
53-
58+
5459
// starting a call with custom context.
5560
callAgent.startCall("USER_ID", callOptions);
5661

@@ -61,7 +66,6 @@ The maximum length of a VOIP header key is 64 chars. These headers can be sent w
6166
### Parsing and reading custom context headers using the WebJS calling SDK
6267
```js
6368
let info = '';
64-
6569
callAgent.on("incomingCall", (args) => {
6670
const incomingCall = args.incomingCall;
6771
if (incomingCall.customContext) {

0 commit comments

Comments
 (0)