@cognigy/rest-api-client
Version:
Cognigy REST-Client
60 lines • 1.86 kB
JavaScript
import { __awaiter } from "tslib";
/** Custom Modules */
import { createNodeDescriptor } from "../../../createNodeDescriptor";
/** Helper Modules */
import { nodeColor } from '../utils/design';
export const dtmfNode = createNodeDescriptor({
type: "dtmf",
defaultLabel: "DTMF",
summary: "UI__NODE_EDITOR__VOICEGATEWAY2__DTMF__SUMMARY",
preview: {
key: "dtmf",
type: "text"
},
appearance: {
color: nodeColor
},
tags: ["voice"],
fields: [
{
key: "dtmf",
label: "UI__NODE_EDITOR__VOICEGATEWAY2__DTMF__FIELDS__DTMF__LABEL",
description: "UI__NODE_EDITOR__VOICEGATEWAY2__DTMF__FIELDS__DTMF__DESCRIPTION",
type: "cognigyText",
params: {
required: true
}
},
{
key: "duration",
label: "UI__NODE_EDITOR__VOICEGATEWAY2__DTMF__FIELDS__DURATION__LABEL",
description: "UI__NODE_EDITOR__VOICEGATEWAY2__DTMF__FIELDS__DURATION__DESCRIPTION",
type: "slider",
defaultValue: 500,
params: {
min: 500,
max: 1000,
step: 50
}
}
],
function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () {
const { api } = cognigy;
const { dtmf, duration } = config;
const voiceGateway2Payload = {
dtmf: {
dtmf,
duration
}
};
yield api.say(null, {
_cognigy: {
_voiceGateway2: {
json: voiceGateway2Payload
}
}
});
api.logDebugMessage(`UI__DEBUG_MODE__DTMF__MESSAGE '${dtmf}' UI__DEBUG_MODE__DTMF__MESSAGE_2 ${duration}ms`);
})
});
//# sourceMappingURL=dtmf.js.map