@cognigy/rest-api-client
Version:
Cognigy REST-Client
62 lines • 1.92 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.dtmfNode = void 0;
/** Custom Modules */
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
/** Helper Modules */
const design_1 = require("../utils/design");
exports.dtmfNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
type: "dtmf",
defaultLabel: "DTMF",
summary: "UI__NODE_EDITOR__VOICEGATEWAY2__DTMF__SUMMARY",
preview: {
key: "dtmf",
type: "text"
},
appearance: {
color: design_1.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: async ({ cognigy, config }) => {
const { api } = cognigy;
const { dtmf, duration } = config;
const voiceGateway2Payload = {
dtmf: {
dtmf,
duration
}
};
await 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