diff --git a/lib/utils.js b/lib/utils.js index cc97b10..42e0cd1 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -16,7 +16,8 @@ const validateCallUpdate = (opts) => { whisper, conf_hold_status, sip_request, - dub + dub, + media_path } = opts; assert.ok(call_hook || child_call_hook || call_status || @@ -32,6 +33,9 @@ const validateCallUpdate = (opts) => { if (conf_hold_status) assert.ok(['hold', 'unhold'].includes(conf_hold_status), `invalid mute_status: ${mute_status}, must be 'mute' or 'unmute'`); + if (media_path) assert.ok(['no-media', 'partial-media', 'full-media'].includes(media_path), + `invalid media_path: ${media_path}, must be 'no-media', 'partial-media' or 'full-media'`); + if (whisper) assert.ok(whisper.verb, `invalid whisper: ${JSON.stringify(whisper)}, must be a 'play' or 'say' verb`);