@cognigy/rest-api-client 2025.18.1 → 2025.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/build/authentication/OAuth2/OAuth2Authentication.js +2 -0
- package/build/connector/AxiosAdapter.js +4 -1
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +20 -6
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +39 -3
- package/build/shared/interfaces/handover.js +3 -1
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/dist/esm/authentication/OAuth2/OAuth2Authentication.js +2 -0
- package/dist/esm/connector/AxiosAdapter.js +4 -1
- package/dist/esm/shared/charts/descriptors/voice/mappers/transfer.mapper.js +20 -6
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/transfer.js +39 -3
- package/dist/esm/shared/interfaces/handover.js +3 -1
- package/dist/esm/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/package.json +1 -1
- package/types/index.d.ts +1039 -1028
- package/build/test.js +0 -39
- package/dist/esm/shared/interfaces/restAPI/management/authentication/ICreateJWTToken.js +0 -1
- package/dist/esm/test.js +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -105,6 +105,8 @@ exports.OAuth2Authentication = function (credentials, self) {
|
|
|
105
105
|
break;
|
|
106
106
|
case "refreshToken":
|
|
107
107
|
{
|
|
108
|
+
// The refresh token from the parameters is to support older token granted via Password Grant flow
|
|
109
|
+
// TODO - remove this in future once PKCE fully takes over
|
|
108
110
|
const { refreshToken } = parameters;
|
|
109
111
|
const credentials = self.credentials;
|
|
110
112
|
const result = await refreshTokenGrant({
|
|
@@ -117,7 +117,7 @@ class AxiosAdapter {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
if (isAxiosResponse(axiosResponse)) {
|
|
120
|
-
|
|
120
|
+
let errorClass = errors_1.ErrorCollection[(_b = axiosResponse.data) === null || _b === void 0 ? void 0 : _b.code] ||
|
|
121
121
|
errors_1.ErrorCollection[axiosResponse.status] ||
|
|
122
122
|
errors_1.ErrorCollection[errors_1.ErrorCode.INTERNAL_SERVER_ERROR];
|
|
123
123
|
if ((axiosResponse.status === HttpStatusCode_1.HttpStatusCode.UNAUTHORIZED ||
|
|
@@ -126,6 +126,9 @@ class AxiosAdapter {
|
|
|
126
126
|
typeof this.config.onUnauthorized === "function") {
|
|
127
127
|
this.config.onUnauthorized();
|
|
128
128
|
}
|
|
129
|
+
if (axiosResponse.status === HttpStatusCode_1.HttpStatusCode.CONFLICT) {
|
|
130
|
+
errorClass = errors_1.ErrorCollection[errors_1.ErrorCode.CONFLICT_ERROR];
|
|
131
|
+
}
|
|
129
132
|
if (IOAuth2ErrorResponse_1.OAuth2Errors.includes((_d = axiosResponse.data) === null || _d === void 0 ? void 0 : _d.error)) {
|
|
130
133
|
throw new errorClass(axiosResponse.data.detail, { traceId: axiosResponse.data.traceId }, undefined, axiosResponse.data);
|
|
131
134
|
}
|
|
@@ -5,7 +5,7 @@ exports.prepareTransferParams = exports.transfer = void 0;
|
|
|
5
5
|
const helper_1 = require("../../../descriptors/voicegateway2/utils/helper");
|
|
6
6
|
const helper_2 = require("../utils/helper");
|
|
7
7
|
exports.transfer = {
|
|
8
|
-
handleInput(endpointType, params, isGenericNode = false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia) {
|
|
8
|
+
handleInput(endpointType, params, isGenericNode = false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia) {
|
|
9
9
|
try {
|
|
10
10
|
switch (endpointType) {
|
|
11
11
|
case "bandwidth":
|
|
@@ -24,14 +24,14 @@ exports.transfer = {
|
|
|
24
24
|
return this.handleAudioCodesInput((0, exports.prepareTransferParams)(params), endpointType);
|
|
25
25
|
case "voiceGateway2":
|
|
26
26
|
default:
|
|
27
|
-
return this.handleVGInput((0, exports.prepareTransferParams)(params), recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia);
|
|
27
|
+
return this.handleVGInput((0, exports.prepareTransferParams)(params), recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
catch (error) {
|
|
31
31
|
throw Error(error.message);
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
handleVGInput(transferParam, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia) {
|
|
34
|
+
handleVGInput(transferParam, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia) {
|
|
35
35
|
const { transferType, transferTarget, transferReason, referredBy, useTransferSipHeaders, transferSipHeaders, dialMusic, dialTranscriptionWebhook, dialCallerId, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, dialTimeout, timeLimit, sttLabel } = transferParam;
|
|
36
36
|
const payload = {
|
|
37
37
|
_voiceGateway2: {
|
|
@@ -55,6 +55,19 @@ exports.transfer = {
|
|
|
55
55
|
if (timeLimit && timeLimit > 0) {
|
|
56
56
|
dialVerb.timeLimit = timeLimit;
|
|
57
57
|
}
|
|
58
|
+
if (process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true") {
|
|
59
|
+
if (typeof anchorMedia === "boolean") {
|
|
60
|
+
dialVerb.anchorMedia = anchorMedia;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
if (mediaPath) {
|
|
65
|
+
dialVerb.mediaPath = mediaPath;
|
|
66
|
+
}
|
|
67
|
+
else if (typeof anchorMedia === "boolean") {
|
|
68
|
+
dialVerb.mediaPath = anchorMedia ? "fullMedia" : "partialMedia";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
58
71
|
if (amdEnabled) {
|
|
59
72
|
dialVerb.amd = {
|
|
60
73
|
actionHook: "amd"
|
|
@@ -75,6 +88,9 @@ exports.transfer = {
|
|
|
75
88
|
};
|
|
76
89
|
/* By default we set the target to phone */
|
|
77
90
|
dialVerb.target = [phoneTarget];
|
|
91
|
+
if (process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true") {
|
|
92
|
+
delete dialVerb.mediaPath;
|
|
93
|
+
}
|
|
78
94
|
/* If targets includes an @ we set the target to sip */
|
|
79
95
|
if (transferTarget === null || transferTarget === void 0 ? void 0 : transferTarget.includes("@")) {
|
|
80
96
|
dialVerb.target = [sipTarget];
|
|
@@ -137,12 +153,10 @@ exports.transfer = {
|
|
|
137
153
|
}
|
|
138
154
|
dialVerb.callerId = dialCallerId;
|
|
139
155
|
}
|
|
140
|
-
if (anchorMedia) {
|
|
141
|
-
dialVerb.anchorMedia = anchorMedia;
|
|
142
|
-
}
|
|
143
156
|
payload._voiceGateway2.json["dial"] = dialVerb;
|
|
144
157
|
break;
|
|
145
158
|
case "refer":
|
|
159
|
+
mediaPath = undefined;
|
|
146
160
|
default:
|
|
147
161
|
const referVerb = {
|
|
148
162
|
"referTo": (0, helper_1.cleanTarget)(transferTarget, false),
|
|
@@ -81,6 +81,33 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
81
81
|
value: "dial"
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
+
{
|
|
85
|
+
key: "mediaPath",
|
|
86
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__LABEL",
|
|
87
|
+
type: "select",
|
|
88
|
+
description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__DESCRIPTION",
|
|
89
|
+
defaultValue: "partialMedia",
|
|
90
|
+
params: {
|
|
91
|
+
options: [
|
|
92
|
+
{
|
|
93
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__FULL_MEDIA__LABEL",
|
|
94
|
+
value: "fullMedia"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__PARTIAL_MEDIA__LABEL",
|
|
98
|
+
value: "partialMedia"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__NO_MEDIA__LABEL",
|
|
102
|
+
value: "noMedia"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
condition: {
|
|
107
|
+
key: "transferType",
|
|
108
|
+
value: "dial"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
84
111
|
{
|
|
85
112
|
key: "useTransferSipHeaders",
|
|
86
113
|
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__USE_TRANSFER_SIP_HEADERS__LABEL",
|
|
@@ -462,7 +489,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
462
489
|
defaultCollapsed: true,
|
|
463
490
|
fields: [
|
|
464
491
|
"referredBy",
|
|
465
|
-
"anchorMedia",
|
|
492
|
+
process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true" ? "anchorMedia" : "mediaPath",
|
|
466
493
|
"useTransferSipHeaders",
|
|
467
494
|
"transferSipHeaders",
|
|
468
495
|
"enableAnsweringMachineDetection"
|
|
@@ -526,7 +553,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
526
553
|
summary: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__SUMMARY",
|
|
527
554
|
function: async ({ cognigy, config, }) => {
|
|
528
555
|
const { api, input } = cognigy;
|
|
529
|
-
const { transferType, transferTarget, referredBy,
|
|
556
|
+
const { transferType, transferTarget, referredBy, mediaPath, useTransferSipHeaders, transferSipHeaders = {}, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId, recognitionChannel, sttVendor, sttLanguage, sttDisablePunctuation, dialTimeout, enableTimeLimit, timeLimit, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, sttLabel, googleModel, sttDeepgramModel, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, agentAssistEnabled, agentAssistHeadersKey = customHeaderDefaultValue, anchorMedia } = config;
|
|
530
557
|
const transferParams = {
|
|
531
558
|
transferType,
|
|
532
559
|
transferReason,
|
|
@@ -544,6 +571,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
544
571
|
timeLimit,
|
|
545
572
|
sttLabel,
|
|
546
573
|
};
|
|
574
|
+
let media = mediaPath;
|
|
547
575
|
try {
|
|
548
576
|
if (input.channel === "adminconsole") {
|
|
549
577
|
let textWarningAdminChannel = "Transferring a call is not supported in the Interaction Panel, please use the VoiceGateway endpoint.";
|
|
@@ -556,6 +584,14 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
556
584
|
if (!enableTimeLimit) {
|
|
557
585
|
delete transferParams.timeLimit;
|
|
558
586
|
}
|
|
587
|
+
if (transferType === "dial" && typeof anchorMedia === "boolean" && (mediaPath === null || mediaPath === undefined) && process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "false") {
|
|
588
|
+
if (anchorMedia) {
|
|
589
|
+
media = "fullMedia";
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
media = "partialMedia";
|
|
593
|
+
}
|
|
594
|
+
}
|
|
559
595
|
if (agentAssistEnabled && dialTranscriptionWebhook) {
|
|
560
596
|
try {
|
|
561
597
|
const agentAssistConfigId = api.getAgentAssistConfigId();
|
|
@@ -591,7 +627,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
591
627
|
transferParams.useTransferSipHeaders = false;
|
|
592
628
|
api.log("error", "Invalid JSON in Transfer SIP Headers");
|
|
593
629
|
}
|
|
594
|
-
const payload = transfer_mapper_1.transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia);
|
|
630
|
+
const payload = transfer_mapper_1.transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, media, anchorMedia);
|
|
595
631
|
await api.say(null, {
|
|
596
632
|
_cognigy: payload,
|
|
597
633
|
});
|
|
@@ -122,6 +122,7 @@ exports.handoverSettingsSchema = {
|
|
|
122
122
|
redactTranscriptTileMessages: { type: "boolean" },
|
|
123
123
|
enableAgentCopilotAuthentication: { type: "boolean" },
|
|
124
124
|
agentCopilotAuthentication: { type: "string" },
|
|
125
|
+
oAuth2Connection: { type: "string" },
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
}
|
|
@@ -154,7 +155,8 @@ exports.foreignSessionDataSchema = {
|
|
|
154
155
|
clientPollTimeout: { type: "number" },
|
|
155
156
|
accessToken: { type: "string" },
|
|
156
157
|
lastEventId: { type: "string" },
|
|
157
|
-
apiKey: { type: "string" }
|
|
158
|
+
apiKey: { type: "string" },
|
|
159
|
+
endHandoverOnParticipantChange: { type: "boolean" }
|
|
158
160
|
}
|
|
159
161
|
};
|
|
160
162
|
exports.rceSettingsSchema = {
|
|
@@ -41,6 +41,7 @@ exports.endpointTypes = [
|
|
|
41
41
|
"zoomContactCenter",
|
|
42
42
|
];
|
|
43
43
|
const transferTypes = ["dial", "sip:refer"];
|
|
44
|
+
const mediaPathTypes = ["fullMedia", "partialMedia", "noMedia"];
|
|
44
45
|
exports.webchatPersistentMenuSchema = {
|
|
45
46
|
title: "webchatPersistentMenuSchema",
|
|
46
47
|
type: "object",
|
|
@@ -154,6 +155,7 @@ const callFailoverSettingsSchema = {
|
|
|
154
155
|
deepgramEndpointing: { type: "boolean" },
|
|
155
156
|
deepgramEndpointingValue: { type: "number" },
|
|
156
157
|
dialTranscribeDeepgramTier: { type: "string" },
|
|
158
|
+
mediaPath: { type: "string", enum: [...mediaPathTypes] },
|
|
157
159
|
anchorMedia: { type: "boolean" }
|
|
158
160
|
}
|
|
159
161
|
};
|
|
@@ -103,6 +103,8 @@ export const OAuth2Authentication = function (credentials, self) {
|
|
|
103
103
|
break;
|
|
104
104
|
case "refreshToken":
|
|
105
105
|
{
|
|
106
|
+
// The refresh token from the parameters is to support older token granted via Password Grant flow
|
|
107
|
+
// TODO - remove this in future once PKCE fully takes over
|
|
106
108
|
const { refreshToken } = parameters;
|
|
107
109
|
const credentials = self.credentials;
|
|
108
110
|
const result = yield refreshTokenGrant({
|
|
@@ -129,7 +129,7 @@ export class AxiosAdapter {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
if (isAxiosResponse(axiosResponse)) {
|
|
132
|
-
|
|
132
|
+
let errorClass = ErrorCollection[(_b = axiosResponse.data) === null || _b === void 0 ? void 0 : _b.code] ||
|
|
133
133
|
ErrorCollection[axiosResponse.status] ||
|
|
134
134
|
ErrorCollection[ErrorCode.INTERNAL_SERVER_ERROR];
|
|
135
135
|
if ((axiosResponse.status === HttpStatusCode.UNAUTHORIZED ||
|
|
@@ -138,6 +138,9 @@ export class AxiosAdapter {
|
|
|
138
138
|
typeof this.config.onUnauthorized === "function") {
|
|
139
139
|
this.config.onUnauthorized();
|
|
140
140
|
}
|
|
141
|
+
if (axiosResponse.status === HttpStatusCode.CONFLICT) {
|
|
142
|
+
errorClass = ErrorCollection[ErrorCode.CONFLICT_ERROR];
|
|
143
|
+
}
|
|
141
144
|
if (OAuth2Errors.includes((_d = axiosResponse.data) === null || _d === void 0 ? void 0 : _d.error)) {
|
|
142
145
|
throw new errorClass(axiosResponse.data.detail, { traceId: axiosResponse.data.traceId }, undefined, axiosResponse.data);
|
|
143
146
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cleanTarget } from "../../../descriptors/voicegateway2/utils/helper";
|
|
3
3
|
import { isValidUrl, isValidPhoneNumber } from "../utils/helper";
|
|
4
4
|
export const transfer = {
|
|
5
|
-
handleInput(endpointType, params, isGenericNode = false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia) {
|
|
5
|
+
handleInput(endpointType, params, isGenericNode = false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia) {
|
|
6
6
|
try {
|
|
7
7
|
switch (endpointType) {
|
|
8
8
|
case "bandwidth":
|
|
@@ -21,14 +21,14 @@ export const transfer = {
|
|
|
21
21
|
return this.handleAudioCodesInput(prepareTransferParams(params), endpointType);
|
|
22
22
|
case "voiceGateway2":
|
|
23
23
|
default:
|
|
24
|
-
return this.handleVGInput(prepareTransferParams(params), recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia);
|
|
24
|
+
return this.handleVGInput(prepareTransferParams(params), recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
catch (error) {
|
|
28
28
|
throw Error(error.message);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
handleVGInput(transferParam, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia) {
|
|
31
|
+
handleVGInput(transferParam, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia) {
|
|
32
32
|
const { transferType, transferTarget, transferReason, referredBy, useTransferSipHeaders, transferSipHeaders, dialMusic, dialTranscriptionWebhook, dialCallerId, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, dialTimeout, timeLimit, sttLabel } = transferParam;
|
|
33
33
|
const payload = {
|
|
34
34
|
_voiceGateway2: {
|
|
@@ -52,6 +52,19 @@ export const transfer = {
|
|
|
52
52
|
if (timeLimit && timeLimit > 0) {
|
|
53
53
|
dialVerb.timeLimit = timeLimit;
|
|
54
54
|
}
|
|
55
|
+
if (process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true") {
|
|
56
|
+
if (typeof anchorMedia === "boolean") {
|
|
57
|
+
dialVerb.anchorMedia = anchorMedia;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (mediaPath) {
|
|
62
|
+
dialVerb.mediaPath = mediaPath;
|
|
63
|
+
}
|
|
64
|
+
else if (typeof anchorMedia === "boolean") {
|
|
65
|
+
dialVerb.mediaPath = anchorMedia ? "fullMedia" : "partialMedia";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
55
68
|
if (amdEnabled) {
|
|
56
69
|
dialVerb.amd = {
|
|
57
70
|
actionHook: "amd"
|
|
@@ -72,6 +85,9 @@ export const transfer = {
|
|
|
72
85
|
};
|
|
73
86
|
/* By default we set the target to phone */
|
|
74
87
|
dialVerb.target = [phoneTarget];
|
|
88
|
+
if (process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true") {
|
|
89
|
+
delete dialVerb.mediaPath;
|
|
90
|
+
}
|
|
75
91
|
/* If targets includes an @ we set the target to sip */
|
|
76
92
|
if (transferTarget === null || transferTarget === void 0 ? void 0 : transferTarget.includes("@")) {
|
|
77
93
|
dialVerb.target = [sipTarget];
|
|
@@ -134,12 +150,10 @@ export const transfer = {
|
|
|
134
150
|
}
|
|
135
151
|
dialVerb.callerId = dialCallerId;
|
|
136
152
|
}
|
|
137
|
-
if (anchorMedia) {
|
|
138
|
-
dialVerb.anchorMedia = anchorMedia;
|
|
139
|
-
}
|
|
140
153
|
payload._voiceGateway2.json["dial"] = dialVerb;
|
|
141
154
|
break;
|
|
142
155
|
case "refer":
|
|
156
|
+
mediaPath = undefined;
|
|
143
157
|
default:
|
|
144
158
|
const referVerb = {
|
|
145
159
|
"referTo": cleanTarget(transferTarget, false),
|
|
@@ -79,6 +79,33 @@ export const transferNode = createNodeDescriptor({
|
|
|
79
79
|
value: "dial"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
key: "mediaPath",
|
|
84
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__LABEL",
|
|
85
|
+
type: "select",
|
|
86
|
+
description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__DESCRIPTION",
|
|
87
|
+
defaultValue: "partialMedia",
|
|
88
|
+
params: {
|
|
89
|
+
options: [
|
|
90
|
+
{
|
|
91
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__FULL_MEDIA__LABEL",
|
|
92
|
+
value: "fullMedia"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__PARTIAL_MEDIA__LABEL",
|
|
96
|
+
value: "partialMedia"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__NO_MEDIA__LABEL",
|
|
100
|
+
value: "noMedia"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
condition: {
|
|
105
|
+
key: "transferType",
|
|
106
|
+
value: "dial"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
82
109
|
{
|
|
83
110
|
key: "useTransferSipHeaders",
|
|
84
111
|
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__USE_TRANSFER_SIP_HEADERS__LABEL",
|
|
@@ -460,7 +487,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
460
487
|
defaultCollapsed: true,
|
|
461
488
|
fields: [
|
|
462
489
|
"referredBy",
|
|
463
|
-
"anchorMedia",
|
|
490
|
+
process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true" ? "anchorMedia" : "mediaPath",
|
|
464
491
|
"useTransferSipHeaders",
|
|
465
492
|
"transferSipHeaders",
|
|
466
493
|
"enableAnsweringMachineDetection"
|
|
@@ -524,7 +551,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
524
551
|
summary: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__SUMMARY",
|
|
525
552
|
function: ({ cognigy, config, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
526
553
|
const { api, input } = cognigy;
|
|
527
|
-
const { transferType, transferTarget, referredBy,
|
|
554
|
+
const { transferType, transferTarget, referredBy, mediaPath, useTransferSipHeaders, transferSipHeaders = {}, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId, recognitionChannel, sttVendor, sttLanguage, sttDisablePunctuation, dialTimeout, enableTimeLimit, timeLimit, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, sttLabel, googleModel, sttDeepgramModel, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, agentAssistEnabled, agentAssistHeadersKey = customHeaderDefaultValue, anchorMedia } = config;
|
|
528
555
|
const transferParams = {
|
|
529
556
|
transferType,
|
|
530
557
|
transferReason,
|
|
@@ -542,6 +569,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
542
569
|
timeLimit,
|
|
543
570
|
sttLabel,
|
|
544
571
|
};
|
|
572
|
+
let media = mediaPath;
|
|
545
573
|
try {
|
|
546
574
|
if (input.channel === "adminconsole") {
|
|
547
575
|
let textWarningAdminChannel = "Transferring a call is not supported in the Interaction Panel, please use the VoiceGateway endpoint.";
|
|
@@ -554,6 +582,14 @@ export const transferNode = createNodeDescriptor({
|
|
|
554
582
|
if (!enableTimeLimit) {
|
|
555
583
|
delete transferParams.timeLimit;
|
|
556
584
|
}
|
|
585
|
+
if (transferType === "dial" && typeof anchorMedia === "boolean" && (mediaPath === null || mediaPath === undefined) && process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "false") {
|
|
586
|
+
if (anchorMedia) {
|
|
587
|
+
media = "fullMedia";
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
media = "partialMedia";
|
|
591
|
+
}
|
|
592
|
+
}
|
|
557
593
|
if (agentAssistEnabled && dialTranscriptionWebhook) {
|
|
558
594
|
try {
|
|
559
595
|
const agentAssistConfigId = api.getAgentAssistConfigId();
|
|
@@ -589,7 +625,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
589
625
|
transferParams.useTransferSipHeaders = false;
|
|
590
626
|
api.log("error", "Invalid JSON in Transfer SIP Headers");
|
|
591
627
|
}
|
|
592
|
-
const payload = transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia);
|
|
628
|
+
const payload = transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, media, anchorMedia);
|
|
593
629
|
yield api.say(null, {
|
|
594
630
|
_cognigy: payload,
|
|
595
631
|
});
|
|
@@ -119,6 +119,7 @@ export const handoverSettingsSchema = {
|
|
|
119
119
|
redactTranscriptTileMessages: { type: "boolean" },
|
|
120
120
|
enableAgentCopilotAuthentication: { type: "boolean" },
|
|
121
121
|
agentCopilotAuthentication: { type: "string" },
|
|
122
|
+
oAuth2Connection: { type: "string" },
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -151,7 +152,8 @@ export const foreignSessionDataSchema = {
|
|
|
151
152
|
clientPollTimeout: { type: "number" },
|
|
152
153
|
accessToken: { type: "string" },
|
|
153
154
|
lastEventId: { type: "string" },
|
|
154
|
-
apiKey: { type: "string" }
|
|
155
|
+
apiKey: { type: "string" },
|
|
156
|
+
endHandoverOnParticipantChange: { type: "boolean" }
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
export const rceSettingsSchema = {
|
|
@@ -38,6 +38,7 @@ export const endpointTypes = [
|
|
|
38
38
|
"zoomContactCenter",
|
|
39
39
|
];
|
|
40
40
|
const transferTypes = ["dial", "sip:refer"];
|
|
41
|
+
const mediaPathTypes = ["fullMedia", "partialMedia", "noMedia"];
|
|
41
42
|
export const webchatPersistentMenuSchema = {
|
|
42
43
|
title: "webchatPersistentMenuSchema",
|
|
43
44
|
type: "object",
|
|
@@ -151,6 +152,7 @@ const callFailoverSettingsSchema = {
|
|
|
151
152
|
deepgramEndpointing: { type: "boolean" },
|
|
152
153
|
deepgramEndpointingValue: { type: "number" },
|
|
153
154
|
dialTranscribeDeepgramTier: { type: "string" },
|
|
155
|
+
mediaPath: { type: "string", enum: [...mediaPathTypes] },
|
|
154
156
|
anchorMedia: { type: "boolean" }
|
|
155
157
|
}
|
|
156
158
|
};
|