mirror of
https://github.com/jambonz/jambonz-node.git
synced 2026-07-04 19:31:48 +00:00
add support for sip_request in updateCall
This commit is contained in:
+14
-1
@@ -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
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user