add support for sip_request in updateCall

This commit is contained in:
Dave Horton
2022-03-05 12:06:46 -05:00
parent 927f1041a6
commit b88e697d61
2 changed files with 15 additions and 2 deletions
+14 -1
View File
@@ -74,7 +74,16 @@ function validate(name, data) {
* Validate the payload for an updateCall request
*/
const validateCallUpdate = (opts) => {
const {call_hook, child_call_hook, call_status, listen_status, mute_status, whisper, conf_hold_status} = opts;
const {
call_hook,
child_call_hook,
call_status,
listen_status,
mute_status,
whisper,
conf_hold_status,
sip_request
} = opts;
assert.ok(call_hook || child_call_hook || call_status || listen_status || mute_status || whisper || conf_hold_status,
`calls.update: invalid request ${JSON.stringify(opts)}`);
@@ -90,6 +99,10 @@ const validateCallUpdate = (opts) => {
if (whisper) assert.ok(whisper.verb,
`invalid whisper: ${JSON.stringify(whisper)}, must be a 'play' or 'say' verb`);
if (sip_request) assert.ok(sip_request.method,
`invalid sip_request: ${JSON.stringify(whisper)}, must include a 'method' property`);
};
/**
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@jambonz/node-client",
"version": "0.3.10",
"version": "0.3.11",
"description": "Node.js client for building jambonz applications (jambonz.org)",
"main": "lib/index.js",
"scripts": {