mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
ws command can have call_id
This commit is contained in:
@@ -229,7 +229,7 @@ class WsRequestor extends BaseRequestor {
|
||||
/* messages must be JSON format */
|
||||
try {
|
||||
const obj = JSON.parse(content);
|
||||
const {type, msgid, command, queueCommand = false, data} = obj;
|
||||
const {type, msgid, command, call_sid = this.call_sid, queueCommand = false, data} = obj;
|
||||
|
||||
this.logger.debug({obj}, 'WsRequestor:request websocket: received');
|
||||
assert.ok(type, 'type property not supplied');
|
||||
@@ -243,7 +243,7 @@ class WsRequestor extends BaseRequestor {
|
||||
case 'command':
|
||||
assert.ok(command, 'command property not supplied');
|
||||
assert.ok(data, 'data property not supplied');
|
||||
this._recvCommand(msgid, command, queueCommand, data);
|
||||
this._recvCommand(msgid, command, call_sid, queueCommand, data);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -266,10 +266,10 @@ class WsRequestor extends BaseRequestor {
|
||||
success && success(data);
|
||||
}
|
||||
|
||||
_recvCommand(msgid, command, queueCommand, data) {
|
||||
_recvCommand(msgid, command, call_sid, queueCommand, data) {
|
||||
// TODO: validate command
|
||||
this.logger.info({msgid, command, queueCommand, data}, 'received command');
|
||||
this.emit('command', {msgid, command, queueCommand, data});
|
||||
this.logger.info({msgid, command, call_sid, queueCommand, data}, 'received command');
|
||||
this.emit('command', {msgid, command, call_sid, queueCommand, data});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user