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
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,17 @@ ms.author: micahvivion
10
10
services: azure-communication-services
11
11
---
12
12
13
-
# How to pass contextual data between calls
13
+
# Using the ACS calling SDK to pass contextual data between calls
14
14
15
-
The ACS WebJS SDK allows developers to pass along custom contextual information when routing calls. Developers can pass metadata about the call, callee or any other information that is relevant to their application or business logic. This allows businesses to manage, and route calls across networks without having to worry about losing context.
15
+
The Azure Communication Services (ACS) WebJS SDK provides 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.
16
16
17
-
Passing context is supported by specifying custom headers. These are an optional list of key-value pairs that can be included as part of `AddParticipant` or `Transfer` actions. The context can be later retrieved as part of the `IncomingCall` event payload.
17
+
To pass this context, developers can utilize custom headers, which are a set of optional key-value pairs. These pairs can be incorporated into the 'AddParticipant' or 'Transfer' actions within the calling SDK. After this Content has been added you can. access this. payload. through Apis to inspect his context can be accessed as part of the payload for the IncomingCall event. By using the ability to look up metadata quickly and have it be associated with a call developers can eliminate additional external database lookups and instead have content information be available within the call object.
18
18
19
-
Custom call context is also forwarded to the SIP protocol, this includes both the freeform custom headers as well as the standard User-to-User Information (UUI) SIP header. When routing an inbound call from your telephony network, the data set from your SBC in the custom headers and UUI is similarly included in the `IncomingCall` event payload.
19
+
Moreover, the custom call context is also transmitted to 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.
20
20
21
-
All custom context data is opaque to the calling SDK and when used in SIP protocols and its content is unrelated to any basic functions.
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.
22
+
Below are tutorials to assist you in implementing custom context headers with the WebJS SDK.
22
23
23
-
Below are samples on how to get started using custom context headers using the WebJS SDK.
24
24
25
25
## Technical parameters
26
26
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.
@@ -31,7 +31,7 @@ The maximum length of a VOIP header key is 64 chars. These headers can be sent w
31
31
32
32
## Adding custom context when inviting a participant
33
33
34
-
### Setting custom context.
34
+
### Setting custom context headings using the WebJS calling SDK
35
35
36
36
```js
37
37
@@ -58,9 +58,10 @@ The maximum length of a VOIP header key is 64 chars. These headers can be sent w
58
58
59
59
// adding participant to existing call or transfer with custom context.
60
60
call.addParticipant("USER_ID", callOptions);
61
-
62
-
// Parsing custom context on the receiver side.
63
-
61
+
```
62
+
63
+
### Parsing and reading custom context headers using the WebJS calling SDK
64
+
```js
64
65
let info ='';
65
66
66
67
callAgent.on("incomingCall", (args) => {
@@ -80,11 +81,8 @@ The maximum length of a VOIP header key is 64 chars. These headers can be sent w
80
81
81
82
```
82
83
83
-
## Reading custom context from an incoming call event
84
-
85
-
86
84
## Additional resources
87
85
88
-
- For a sample payload of the incoming call, refer to this [guide](../../../event-grid/communication-services-voice-video-events.md#microsoftcommunicationincomingcall).
86
+
- For more details on how to pass contextual data using ACS Call automation see this [guide](../../../how-tos/call-automation/custom-context.md).
89
87
90
88
- Learn more about [SIP protocol details for direct routing](../../concepts/telephony/direct-routing-sip-specification.md).
0 commit comments