From e5f7c6d809eea8cd17335aced34455b00a151a22 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Wed, 15 Nov 2023 13:37:01 +0700 Subject: [PATCH] support inband dtmf --- lib/routes/api/accounts.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/routes/api/accounts.js b/lib/routes/api/accounts.js index 89313d3..64062f7 100644 --- a/lib/routes/api/accounts.js +++ b/lib/routes/api/accounts.js @@ -224,7 +224,8 @@ function validateUpdateCall(opts) { 'conf_mute_status', 'mute_status', 'sip_request', - 'record' + 'record', + 'inband_dtmf', ] .reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0); @@ -266,6 +267,9 @@ function validateUpdateCall(opts) { if (opts.record && !opts.record.action) { throw new DbErrorBadRequest('record requires action property'); } + if (opts.inband_dtmf && !['digit'].includes(opts.inband_dtmf)) { + throw new DbErrorBadRequest('invalid inband_dtmf'); + } if ('startCallRecording' === opts.record?.action && !opts.record.siprecServerURL) { throw new DbErrorBadRequest('record requires siprecServerURL property when starting recording'); }