Compare commits

...
1 Commits
Author SHA1 Message Date
Dave Horton dd85ec762d merge support for X-Override-To feature back into main branch 2022-02-01 12:30:34 -05:00
+10 -2
View File
@@ -124,14 +124,22 @@ class CallSession extends Emitter {
};
if (this.req.locals.registration) {
debug(`sending call to user ${JSON.stringify(this.req.locals.registration)}`);
debug(`sending call to registered user ${JSON.stringify(this.req.locals.registration)}`);
let destUri = this.req.uri;
if (this.req.has('X-Override-To')) {
const dest = this.req.get('X-Override-To');
const uri = parseUri(contact);
uri.user = dest;
destUri = stringifyUri(uri);
this.logger.info(`overriding destination user with ${dest}, so final uri is ${destUri}`);
}
const contact = this.req.locals.registration.contact;
if (contact.includes('transport=ws')) {
uris = [contact];
}
else {
proxy = this.req.locals.registration.proxy;
uris = [this.req.uri];
uris = [destUri];
}
}
else if (this.req.locals.target === 'forward') {