feature: specify user or host part of From uri on outdial

This commit is contained in:
Dave Horton
2022-10-23 15:24:30 -04:00
parent dc378cd065
commit e0607b9c2e
4 changed files with 1056 additions and 330 deletions

View File

@@ -387,6 +387,7 @@
"enum": ["GET", "POST"]
},
"headers": "object",
"from": "#dialFrom",
"name": "string",
"number": "string",
"sipUri": "string",
@@ -400,6 +401,14 @@
"type"
]
},
"dialFrom": {
"properties": {
"user": "string",
"host": "string"
},
"required": [
]
},
"auth": {
"properties": {
"username": "string",

View File

@@ -21,6 +21,7 @@ class SingleDialer extends Emitter {
this.logger = logger;
this.target = target;
this.from = target.from || {};
this.sbcAddress = sbcAddress;
this.opts = opts;
this.application = application;
@@ -66,6 +67,8 @@ class SingleDialer extends Emitter {
opts.headers = {
...opts.headers,
...(this.target.headers || {}),
...(this.from.user && {'X-Preferred-From-User': this.from.user}),
...(this.from.host && {'X-Preferred-From-Host': this.from.host}),
'X-Jambonz-Routing': this.target.type,
'X-Call-Sid': this.callSid,
...(this.applicationSid && {'X-Application-Sid': this.applicationSid})

1370
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,9 +24,9 @@
"jslint": "eslint app.js lib"
},
"dependencies": {
"@jambonz/db-helpers": "^0.6.18",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.4.32",
"@jambonz/db-helpers": "^0.6.19",
"@jambonz/realtimedb-helpers": "^0.4.35",
"@jambonz/stats-collector": "^0.1.6",
"@jambonz/time-series": "^0.2.5",
"@opentelemetry/api": "^1.1.0",