mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-11-02 01:24:52 +00:00
add integration test
This commit is contained in:
1 parent
081a83e121
commit
fc61d3d2fa
8 files changed
+126
-10
No files matched your search
@@ -43,6 +43,7 @@ function validateUpdateCall(opts) {
|
||||
const hasWhisper = opts.whisper;
|
||||
const count = [
|
||||
'call_hook',
|
||||
'child_call_hook',
|
||||
'call_status',
|
||||
'listen_status',
|
||||
'mute_status']
|
||||
@@ -56,11 +57,13 @@ function validateUpdateCall(opts) {
|
||||
case 1:
|
||||
// good
|
||||
break;
|
||||
case 2:
|
||||
if (opts.call_hook && opts.child_call_hook) break;
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
default:
|
||||
throw new DbErrorBadRequest('multiple options are not allowed in updateCall');
|
||||
}
|
||||
|
||||
if (opts.call_hook && !opts.call_hook.url) throw new DbErrorBadRequest('missing call_hook.url');
|
||||
if (opts.call_status && !['completed', 'no-answer'].includes(opts.call_status)) {
|
||||
throw new DbErrorBadRequest('invalid call_status');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user