mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
ws command can have call_id
This commit is contained in:
@@ -726,7 +726,7 @@ class CallSession extends Emitter {
|
|||||||
this.taskIdx = 0;
|
this.taskIdx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onCommand({msgid, command, queueCommand, data}) {
|
_onCommand({msgid, command, call_sid, queueCommand, data}) {
|
||||||
this.logger.info({msgid, command, queueCommand}, 'CallSession:_onCommand - received command');
|
this.logger.info({msgid, command, queueCommand}, 'CallSession:_onCommand - received command');
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 'redirect':
|
case 'redirect':
|
||||||
@@ -751,7 +751,7 @@ class CallSession extends Emitter {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mute:status':
|
case 'mute:status':
|
||||||
this._lccMuteStatus(this.callSid, data);
|
this._lccMuteStatus(call_sid, data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'conf:mute-status':
|
case 'conf:mute-status':
|
||||||
@@ -767,11 +767,11 @@ class CallSession extends Emitter {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'whisper':
|
case 'whisper':
|
||||||
this._lccWhisper(data, this.callSid);
|
this._lccWhisper(data, call_sid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sip:request':
|
case 'sip:request':
|
||||||
this._lccSipRequest(data, this.callSid)
|
this._lccSipRequest(data, call_sid)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.logger.info({err, data}, `CallSession:_onCommand - error sending ${data.method}`);
|
this.logger.info({err, data}, `CallSession:_onCommand - error sending ${data.method}`);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ class WsRequestor extends BaseRequestor {
|
|||||||
/* messages must be JSON format */
|
/* messages must be JSON format */
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(content);
|
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');
|
this.logger.debug({obj}, 'WsRequestor:request websocket: received');
|
||||||
assert.ok(type, 'type property not supplied');
|
assert.ok(type, 'type property not supplied');
|
||||||
@@ -243,7 +243,7 @@ class WsRequestor extends BaseRequestor {
|
|||||||
case 'command':
|
case 'command':
|
||||||
assert.ok(command, 'command property not supplied');
|
assert.ok(command, 'command property not supplied');
|
||||||
assert.ok(data, 'data 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;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -266,10 +266,10 @@ class WsRequestor extends BaseRequestor {
|
|||||||
success && success(data);
|
success && success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
_recvCommand(msgid, command, queueCommand, data) {
|
_recvCommand(msgid, command, call_sid, queueCommand, data) {
|
||||||
// TODO: validate command
|
// TODO: validate command
|
||||||
this.logger.info({msgid, command, queueCommand, data}, 'received command');
|
this.logger.info({msgid, command, call_sid, queueCommand, data}, 'received command');
|
||||||
this.emit('command', {msgid, command, queueCommand, data});
|
this.emit('command', {msgid, command, call_sid, queueCommand, data});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user