diff --git a/lib/http-routes/api/create-call.js b/lib/http-routes/api/create-call.js index 5be4a9c8..ba30ab6a 100644 --- a/lib/http-routes/api/create-call.js +++ b/lib/http-routes/api/create-call.js @@ -41,7 +41,8 @@ router.post('/', async(req, res) => { 'X-Jambonz-Routing': target.type, 'X-Jambonz-FS-UUID': srf.locals.fsUUID, 'X-Call-Sid': callSid, - 'X-Account-Sid': accountSid + 'X-Account-Sid': accountSid, + ...(restDial.fromHost && {'X-Preferred-From-Host': this.from.host}) }; switch (target.type) { diff --git a/lib/tasks/rest_dial.js b/lib/tasks/rest_dial.js index 76965c29..729e756b 100644 --- a/lib/tasks/rest_dial.js +++ b/lib/tasks/rest_dial.js @@ -11,6 +11,7 @@ class TaskRestDial extends Task { super(logger, opts); this.from = this.data.from; + this.fromHost = this.data.fromHost; this.to = this.data.to; this.call_hook = this.data.call_hook; this.timeout = this.data.timeout || 60; diff --git a/lib/tasks/specs.json b/lib/tasks/specs.json index 270b8a09..d1636e80 100644 --- a/lib/tasks/specs.json +++ b/lib/tasks/specs.json @@ -341,6 +341,7 @@ "call_hook": "object|string", "call_status_hook": "object|string", "from": "string", + "fromHost": "string", "speech_synthesis_vendor": "string", "speech_synthesis_voice": "string", "speech_synthesis_language": "string",