include X-Account-Sid on all outgoing INVITEs

This commit is contained in:
Dave Horton
2020-12-16 13:27:02 -05:00
parent 5c5c9d9ae2
commit ef17ed40f7
4 changed files with 82 additions and 73 deletions

View File

@@ -257,6 +257,7 @@ class TaskDial extends Task {
proxy: `sip:${sbcAddress}`,
callingNumber: this.callerId || req.callingNumber
};
Object.assign(opts.headers, {'X-Account-Sid': cs.accountSid});
const t = this.target.find((t) => t.type === 'teams');
if (t) {

View File

@@ -59,13 +59,12 @@ class Dialogflow extends Task {
this.logger.debug(`starting dialogflow bot ${this.project}`);
// kick it off
const baseArgs = `${this.ep.uuid} ${this.project} ${this.lang} ${this.welcomeEvent}`;
if (this.welcomeEventParams) {
this.ep.api('dialogflow_start',
`${this.ep.uuid} ${this.project} ${this.lang} ${this.welcomeEvent} '${JSON.stringify(this.welcomeEventParams)}'`);
this.ep.api('dialogflow_start', `${baseArgs} '${JSON.stringify(this.welcomeEventParams)}'`);
}
else if (this.welcomeEvent.length) {
this.ep.api('dialogflow_start',
`${this.ep.uuid} ${this.project} ${this.lang} ${this.welcomeEvent}`);
this.ep.api('dialogflow_start', baseArgs);
}
else {
this.ep.api('dialogflow_start', `${this.ep.uuid} ${this.project} ${this.lang}`);