From 1d69457ddcdb17d062cff62e04c415d2e2b916d7 Mon Sep 17 00:00:00 2001 From: Anton Voylenko Date: Fri, 17 Nov 2023 15:48:34 +0200 Subject: [PATCH] support for llc tag (#262) --- 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..ea0151f 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', + 'tag' ] .reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0); @@ -269,6 +270,9 @@ function validateUpdateCall(opts) { if ('startCallRecording' === opts.record?.action && !opts.record.siprecServerURL) { throw new DbErrorBadRequest('record requires siprecServerURL property when starting recording'); } + if (opts.tag && (typeof opts.tag !== 'object' || Array.isArray(opts.tag) || opts.tag === null)) { + throw new DbErrorBadRequest('invalid tag data'); + } } function validateTo(to) {