pass application sid in custom header if provided during authentication

This commit is contained in:
Dave Horton committed 2020-02-14 13:23:14 -05:00
1 parent 09558bbb1d
commit 40c3dcd759
1 file changed
+5
+5
View File
@@ -57,6 +57,11 @@ class CallSession extends Emitter {
if (this.req.locals.application_sid) {
Object.assign(headers, {'X-Application-Sid': this.req.locals.application_sid});
}
else if (this.req.authorization &&
this.req.authorization.grant &&
this.req.authorization.grant.application_sid) {
Object.assign(headers, {'X-Application-Sid': this.req.authorization.grant.application_sid});
}
debug(`sending INVITE to ${proxy} with ${uri}`);
const {uas, uac} = await this.srf.createB2BUA(this.req, this.res, uri, {