diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index 4beef111..e4ff994c 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -110,6 +110,7 @@ class TaskDial extends Task { this.boostAudioSignal = this.data.boostAudioSignal; this._mediaPath = MediaPath.FullMedia; this.forwardPAI = this.data.forwardPAI; + this.srtpEncryption = this.data.srtpEncryption; if (this.dtmfHook) { const {parentDtmfCollector, childDtmfCollector} = parseDtmfOptions(logger, this.data.dtmfCapture || {}); diff --git a/lib/utils/place-outdial.js b/lib/utils/place-outdial.js index fbfe9a2e..843c747b 100644 --- a/lib/utils/place-outdial.js +++ b/lib/utils/place-outdial.js @@ -84,7 +84,11 @@ class SingleDialer extends Emitter { 'X-Jambonz-Routing': this.target.type, 'X-Call-Sid': this.callSid, ...(this.applicationSid && {'X-Application-Sid': this.applicationSid}), - ...(this.target.proxy && {'X-SIP-Proxy': this.target.proxy}) + ...(this.target.proxy && {'X-SIP-Proxy': this.target.proxy}), + /* request encrypted media (SRTP) on the outbound leg for sip: URI targets; + sbc-outbound honors X-Jambonz-SRTP when forwarding the call */ + ...('sip' === this.target.type && this.dialTask?.srtpEncryption && + {'X-Jambonz-SRTP': this.dialTask.srtpEncryption}) }; if (srf.locals.fsUUID) { opts.headers = { diff --git a/package-lock.json b/package-lock.json index bcd62467..308dcae2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@jambonz/speech-utils": "^0.2.30", "@jambonz/stats-collector": "^0.1.10", "@jambonz/time-series": "^0.2.17", - "@jambonz/verb-specifications": "^0.1.12", + "@jambonz/verb-specifications": "^0.1.13", "@modelcontextprotocol/sdk": "^1.9.0", "@opentelemetry/api": "^1.8.0", "@opentelemetry/exporter-jaeger": "^1.23.0", @@ -1643,9 +1643,9 @@ } }, "node_modules/@jambonz/verb-specifications": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.1.12.tgz", - "integrity": "sha512-Ddqk78om3k2l1Kj6IGB945W8KOOEwKPLxWeXao6H4jMCbrRponCN+gFOOFUC8q4KRmoe4yaQ6Y02UkejPtaYzQ==", + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.1.13.tgz", + "integrity": "sha512-z/Nb1RE2ADJDAqcOOlevjWytZOnLyboErn6ZZRtz1VVYsrqaAlctYWaLOw6edFcrF9bfr9XhT6uBSma/1Na/Sw==", "license": "MIT", "dependencies": { "debug": "^4.3.4", diff --git a/package.json b/package.json index 63e2330c..7b7e3e28 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@jambonz/speech-utils": "^0.2.30", "@jambonz/stats-collector": "^0.1.10", "@jambonz/time-series": "^0.2.17", - "@jambonz/verb-specifications": "^0.1.12", + "@jambonz/verb-specifications": "^0.1.13", "@modelcontextprotocol/sdk": "^1.9.0", "@opentelemetry/api": "^1.8.0", "@opentelemetry/exporter-jaeger": "^1.23.0",