use registered contact as uri when sending to user (#31)

This commit is contained in:
Dave Horton
2022-02-17 21:35:19 -05:00
committed by GitHub
parent 23255a71db
commit 78d6cb5f22
3 changed files with 17 additions and 20 deletions
+3 -6
View File
@@ -126,7 +126,7 @@ class CallSession extends Emitter {
if (this.req.locals.registration) {
debug(`sending call to registered user ${JSON.stringify(this.req.locals.registration)}`);
const contact = this.req.locals.registration.contact;
let destUri = this.req.uri;
let destUri = contact;
if (this.req.has('X-Override-To')) {
const dest = this.req.get('X-Override-To');
const uri = parseUri(contact);
@@ -134,12 +134,9 @@ class CallSession extends Emitter {
destUri = stringifyUri(uri);
this.logger.info(`overriding destination user with ${dest}, so final uri is ${destUri}`);
}
if (contact.includes('transport=ws')) {
uris = [contact];
}
else {
uris = [destUri];
if (!contact.includes('transport=ws')) {
proxy = this.req.locals.registration.proxy;
uris = [destUri];
}
}
else if (this.req.locals.target === 'forward') {
+13 -13
View File
@@ -9,7 +9,7 @@
"version": "v0.7.3",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.6.16",
"@jambonz/db-helpers": "^0.6.17",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.1",
"@jambonz/realtimedb-helpers": "^0.4.24",
@@ -1375,9 +1375,9 @@
}
},
"node_modules/@jambonz/db-helpers": {
"version": "0.6.16",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.6.16.tgz",
"integrity": "sha512-jvQULOgoRorevFoZ4RbKIF7QvswSor5sk+THigEId7uPAlaq/GRKCWdEA1rxEizzhfOAiRT6Qg2tyisZ9eg3aA==",
"version": "0.6.17",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.6.17.tgz",
"integrity": "sha512-3L5F6SFVpjn59CO23MpqMydTy1ox2FRe/kry9Zfv8kjTNTSMmfn01c51hjoXcX1v2kdx61qkGvCN6pHlc2LoSQ==",
"dependencies": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.3",
@@ -5483,9 +5483,9 @@
}
},
"node_modules/url-parse": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.4.tgz",
"integrity": "sha512-ITeAByWWoqutFClc/lRZnFplgXgEZr3WJ6XngMM/N9DMIm4K8zXPCZ1Jdu0rERwO84w1WC5wkle2ubwTA4NTBg==",
"version": "1.5.7",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.7.tgz",
"integrity": "sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA==",
"dependencies": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
@@ -6805,9 +6805,9 @@
"dev": true
},
"@jambonz/db-helpers": {
"version": "0.6.16",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.6.16.tgz",
"integrity": "sha512-jvQULOgoRorevFoZ4RbKIF7QvswSor5sk+THigEId7uPAlaq/GRKCWdEA1rxEizzhfOAiRT6Qg2tyisZ9eg3aA==",
"version": "0.6.17",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.6.17.tgz",
"integrity": "sha512-3L5F6SFVpjn59CO23MpqMydTy1ox2FRe/kry9Zfv8kjTNTSMmfn01c51hjoXcX1v2kdx61qkGvCN6pHlc2LoSQ==",
"requires": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.3",
@@ -9889,9 +9889,9 @@
}
},
"url-parse": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.4.tgz",
"integrity": "sha512-ITeAByWWoqutFClc/lRZnFplgXgEZr3WJ6XngMM/N9DMIm4K8zXPCZ1Jdu0rERwO84w1WC5wkle2ubwTA4NTBg==",
"version": "1.5.7",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.7.tgz",
"integrity": "sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA==",
"requires": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
+1 -1
View File
@@ -27,7 +27,7 @@
"jslint": "eslint app.js lib"
},
"dependencies": {
"@jambonz/db-helpers": "^0.6.16",
"@jambonz/db-helpers": "^0.6.17",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.1",
"@jambonz/realtimedb-helpers": "^0.4.24",