mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
bugfix: sip_refer sending body
This commit is contained in:
@@ -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};
|
||||
}
|
||||
|
||||
@@ -770,7 +771,7 @@ class CallSession extends Emitter {
|
||||
break;
|
||||
|
||||
case 'sip:request':
|
||||
this._lccSipRequest(data)
|
||||
this._lccSipRequest(data, this.callSid)
|
||||
.catch((err) => {
|
||||
this.logger.info({err, data}, `CallSession:_onCommand - error sending ${data.method}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user