diff --git a/lib/routes/api/accounts.js b/lib/routes/api/accounts.js index edd3fd2..db338c9 100644 --- a/lib/routes/api/accounts.js +++ b/lib/routes/api/accounts.js @@ -225,7 +225,8 @@ function validateUpdateCall(opts) { 'mute_status', 'sip_request', 'record', - 'dtmf', + 'tag', + 'dtmf' ] .reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0); @@ -273,6 +274,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) {