You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/tutorials/calling-sdk/tutorials/pass-contextual-data-header.md
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,46 +1,52 @@
1
1
---
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
3
3
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
5
5
author: sloanster
6
6
ms.topic: tutorial
7
7
ms.service: azure-communication-services
8
-
ms.date: 09/10/2024
8
+
ms.date: 09/11/2024
9
9
ms.author: micahvivion
10
10
services: azure-communication-services
11
11
---
12
12
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
14
14
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
16
16
17
17
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.
18
18
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.
20
20
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.
> 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.
22
27
23
28
## 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 `=`, `;`, `.`, `!`, `%`, `*`, `_`, `+`, `~`, `-`.
25
34
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.
27
36
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.
29
38
30
39
## Adding custom context when inviting a participant
31
40
32
41
### Adding custom context headings using the WebJS calling SDK
33
42
34
43
```js
35
-
36
44
constcallOptions= {
37
45
customContext: {
38
46
voipHeaders: [
39
47
{key:'voip-key-1', value:'voip-value-1'},
40
48
{key:'voip-key-2', value:'voip-value-2'}
41
49
],
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.
44
50
sipHeaders: [
45
51
{key:'sip-key-1', value:'sip-value-1'},
46
52
{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
49
55
},
50
56
};
51
57
52
-
// you can specify only sipHeaders or voipHeaders or both.
53
-
58
+
54
59
// starting a call with custom context.
55
60
callAgent.startCall("USER_ID", callOptions);
56
61
@@ -61,7 +66,6 @@ The maximum length of a VOIP header key is 64 chars. These headers can be sent w
61
66
### Parsing and reading custom context headers using the WebJS calling SDK
0 commit comments