mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-04-05 18:52:01 +00:00
Compare commits
3 Commits
snyk-upgra
...
snyk-upgra
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
051c07f13f | ||
|
|
8c5cdd374b | ||
|
|
15d784a4b0 |
@@ -584,7 +584,7 @@ class CallSession extends Emitter {
|
||||
task.doConferenceMuteNonModerators(this, opts);
|
||||
}
|
||||
|
||||
async _lccSipRequest(opts) {
|
||||
async _lccSipRequest(opts, callSid) {
|
||||
const {sip_request} = opts;
|
||||
const {method, content_type, content, headers = {}} = sip_request;
|
||||
if (!this.hasStableDialog) {
|
||||
@@ -592,13 +592,14 @@ class CallSession extends Emitter {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const res = await this.dlg.request({
|
||||
const dlg = callSid === this.callSid ? this.dlg : this.currentTask.dlg;
|
||||
const res = await dlg.request({
|
||||
method,
|
||||
headers: {
|
||||
...headers,
|
||||
'Content-Type': content_type,
|
||||
'Content': content
|
||||
}
|
||||
'Content-Type': content_type
|
||||
},
|
||||
body: content
|
||||
});
|
||||
this.logger.debug({res}, `CallSession:_lccSipRequest got response to ${method}`);
|
||||
return res;
|
||||
@@ -683,7 +684,7 @@ class CallSession extends Emitter {
|
||||
await this._lccConfMuteStatus(opts);
|
||||
}
|
||||
else if (opts.sip_request) {
|
||||
const res = await this._lccSipRequest(opts);
|
||||
const res = await this._lccSipRequest(opts, callSid);
|
||||
return {status: res.status, reason: res.reason};
|
||||
}
|
||||
|
||||
@@ -725,7 +726,7 @@ class CallSession extends Emitter {
|
||||
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');
|
||||
switch (command) {
|
||||
case 'redirect':
|
||||
@@ -750,7 +751,7 @@ class CallSession extends Emitter {
|
||||
break;
|
||||
|
||||
case 'mute:status':
|
||||
this._lccMuteStatus(this.callSid, data);
|
||||
this._lccMuteStatus(call_sid, data);
|
||||
break;
|
||||
|
||||
case 'conf:mute-status':
|
||||
@@ -766,11 +767,11 @@ class CallSession extends Emitter {
|
||||
break;
|
||||
|
||||
case 'whisper':
|
||||
this._lccWhisper(data, this.callSid);
|
||||
this._lccWhisper(data, call_sid);
|
||||
break;
|
||||
|
||||
case 'sip:request':
|
||||
this._lccSipRequest(data)
|
||||
this._lccSipRequest(data, call_sid)
|
||||
.catch((err) => {
|
||||
this.logger.info({err, data}, `CallSession:_onCommand - error sending ${data.method}`);
|
||||
});
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
371
package-lock.json
generated
371
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@
|
||||
"debug": "^4.3.2",
|
||||
"deepcopy": "^2.1.0",
|
||||
"drachtio-fsmrf": "^2.0.13",
|
||||
"drachtio-srf": "^4.4.61",
|
||||
"drachtio-srf": "^4.4.62",
|
||||
"express": "^4.17.1",
|
||||
"helmet": "^5.0.2",
|
||||
"ip": "^1.1.5",
|
||||
|
||||
Reference in New Issue
Block a user