add X-Application-Sid in outdials so it ends up in cdr (#374)

This commit is contained in:
Dave Horton
2023-06-09 12:57:35 -04:00
committed by GitHub
parent ffdb7a0bb5
commit ab0452879e
3 changed files with 6 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ router.post('/', async(req, res) => {
'X-Jambonz-FS-UUID': srf.locals.fsUUID, 'X-Jambonz-FS-UUID': srf.locals.fsUUID,
'X-Call-Sid': callSid, 'X-Call-Sid': callSid,
'X-Account-Sid': accountSid, 'X-Account-Sid': accountSid,
...(req.body?.application_sid && {'X-Application-Sid': req.body.application_sid}),
...(restDial.fromHost && {'X-Preferred-From-Host': restDial.fromHost}) ...(restDial.fromHost && {'X-Preferred-From-Host': restDial.fromHost})
}; };

View File

@@ -668,7 +668,7 @@ class TaskDial extends Task {
if (this.parentDtmfCollector) this._installDtmfDetection(cs, cs.dlg); if (this.parentDtmfCollector) this._installDtmfDetection(cs, cs.dlg);
if (this.childDtmfCollector) this._installDtmfDetection(cs, this.dlg); if (this.childDtmfCollector) this._installDtmfDetection(cs, this.dlg);
if (this.transcribeTask) this.transcribeTask.exec(cs, {ep2: this.epOther, ep:this.ep}); if (this.transcribeTask) this.transcribeTask.exec(cs, {ep: this.epOther, ep2:this.ep});
if (this.listenTask) this.listenTask.exec(cs, {ep: this.epOther}); if (this.listenTask) this.listenTask.exec(cs, {ep: this.epOther});
if (this.startAmd) { if (this.startAmd) {
try { try {

View File

@@ -45,6 +45,10 @@ class SingleDialer extends Emitter {
return this.callInfo.callStatus; return this.callInfo.callStatus;
} }
get applicationSid() {
return this.application?.application_sid || this.callInfo?.applicationSid;
}
/** /**
* can be used for all http requests within this session * can be used for all http requests within this session
*/ */