diff --git a/lib/http-routes/api/create-call.js b/lib/http-routes/api/create-call.js index 8c193369..a1432ece 100644 --- a/lib/http-routes/api/create-call.js +++ b/lib/http-routes/api/create-call.js @@ -27,6 +27,7 @@ router.post('/', async(req, res) => { const target = restDial.to; const opts = { callingNumber: restDial.from, + ...(restDial.callerName && {callingName: restDial.callerName}), headers: req.body.headers || {} }; diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index e607803d..4fcbb053 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -85,6 +85,7 @@ class TaskDial extends Task { this.earlyMedia = this.data.answerOnBridge === true; this.callerId = this.data.callerId; + this.callerName = this.data.callerName; this.dialMusic = this.data.dialMusic; this.headers = this.data.headers || {}; this.method = this.data.method || 'POST'; @@ -415,7 +416,8 @@ class TaskDial extends Task { const opts = { headers: this.headers, proxy: `sip:${sbcAddress}`, - callingNumber: this.callerId || req.callingNumber + callingNumber: this.callerId || req.callingNumber, + ...(this.callerName && {callingName: this.callerName}) }; const t = this.target.find((t) => t.type === 'teams'); diff --git a/lib/tasks/rest_dial.js b/lib/tasks/rest_dial.js index cf08801a..36289d33 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.callerName = this.data.callerName; this.fromHost = this.data.fromHost; this.to = this.data.to; this.call_hook = this.data.call_hook; diff --git a/package-lock.json b/package-lock.json index 65e9aef6..2141ef27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@jambonz/speech-utils": "^0.0.12", "@jambonz/stats-collector": "^0.1.8", "@jambonz/time-series": "^0.2.5", - "@jambonz/verb-specifications": "^0.0.12", + "@jambonz/verb-specifications": "^0.0.14", "@opentelemetry/api": "^1.4.0", "@opentelemetry/exporter-jaeger": "^1.9.0", "@opentelemetry/exporter-trace-otlp-http": "^0.35.0", @@ -1664,9 +1664,9 @@ } }, "node_modules/@jambonz/verb-specifications": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.12.tgz", - "integrity": "sha512-NU+9iVCqyn8GI/QG1gKhBb9h9poEIAxfydFdDOpXOXcT4nlwuT/RLM+6X2wJcysqcc2hA/4aPhk0lMnw0H6ejg==", + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.14.tgz", + "integrity": "sha512-yT7I8PmBgmt+GTCno4F5ryL4CQrgIVsE2YUfVjCMg09pjnrumdKVqArFXW8KZsNzbCKjhVTtQE60kJd6gWCQfg==", "dependencies": { "debug": "^4.3.4", "pino": "^8.8.0" @@ -10011,9 +10011,9 @@ } }, "@jambonz/verb-specifications": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.12.tgz", - "integrity": "sha512-NU+9iVCqyn8GI/QG1gKhBb9h9poEIAxfydFdDOpXOXcT4nlwuT/RLM+6X2wJcysqcc2hA/4aPhk0lMnw0H6ejg==", + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.14.tgz", + "integrity": "sha512-yT7I8PmBgmt+GTCno4F5ryL4CQrgIVsE2YUfVjCMg09pjnrumdKVqArFXW8KZsNzbCKjhVTtQE60kJd6gWCQfg==", "requires": { "debug": "^4.3.4", "pino": "^8.8.0" diff --git a/package.json b/package.json index 9f666187..e36b684c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@jambonz/speech-utils": "^0.0.12", "@jambonz/stats-collector": "^0.1.8", "@jambonz/time-series": "^0.2.5", - "@jambonz/verb-specifications": "^0.0.12", + "@jambonz/verb-specifications": "^0.0.14", "@opentelemetry/api": "^1.4.0", "@opentelemetry/exporter-jaeger": "^1.9.0", "@opentelemetry/exporter-trace-otlp-http": "^0.35.0", diff --git a/test/dial-tests.js b/test/dial-tests.js index 55348dad..41937c69 100644 --- a/test/dial-tests.js +++ b/test/dial-tests.js @@ -31,6 +31,7 @@ test('\'dial-phone\'', async(t) => { { "verb": "dial", "callerId": from, + "callerName": "test_callerName", "actionHook": "/actionHook", "timeLimit": 5, "target": [ @@ -56,6 +57,7 @@ test('\'dial-phone\'', async(t) => { "method": "POST", }, "from": from, + "callerName": "Tom", "to": { "type": "phone", "number": "15583084808"