This commit is contained in:
Quan HL
2023-11-28 19:54:10 +07:00
+5 -1
View File
@@ -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) {