From d4e297578f3f66fbb1a379f33bb5913cd77222c1 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 22 Sep 2021 07:40:31 -0400 Subject: [PATCH] LCC: add conference hold and unhold actions --- lib/routes/api/accounts.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/routes/api/accounts.js b/lib/routes/api/accounts.js index 575a7bb..6d7f1c4 100644 --- a/lib/routes/api/accounts.js +++ b/lib/routes/api/accounts.js @@ -91,6 +91,7 @@ function validateUpdateCall(opts) { 'child_call_hook', 'call_status', 'listen_status', + 'conf_hold_status', 'mute_status'] .reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0); @@ -104,6 +105,7 @@ function validateUpdateCall(opts) { break; case 2: if (opts.call_hook && opts.child_call_hook) break; + else if (opts.conf_hold_status && opts.waitHook) break; // eslint-disable-next-line no-fallthrough default: throw new DbErrorBadRequest('multiple options are not allowed in updateCall'); @@ -118,6 +120,9 @@ function validateUpdateCall(opts) { if (opts.mute_status && !['mute', 'unmute'].includes(opts.mute_status)) { throw new DbErrorBadRequest('invalid mute_status'); } + if (opts.conf_hold_status && !['hold', 'unhold'].includes(opts.conf_hold_status)) { + throw new DbErrorBadRequest('invalid conf_hold_status'); + } } function validateTo(to) {