mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
feat: callerName to rest_dial and dial verb (#312)
* feat: callerName to rest_dial and dial verb * update verb specification
This commit is contained in:
@@ -27,6 +27,7 @@ router.post('/', async(req, res) => {
|
|||||||
const target = restDial.to;
|
const target = restDial.to;
|
||||||
const opts = {
|
const opts = {
|
||||||
callingNumber: restDial.from,
|
callingNumber: restDial.from,
|
||||||
|
...(restDial.callerName && {callingName: restDial.callerName}),
|
||||||
headers: req.body.headers || {}
|
headers: req.body.headers || {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class TaskDial extends Task {
|
|||||||
|
|
||||||
this.earlyMedia = this.data.answerOnBridge === true;
|
this.earlyMedia = this.data.answerOnBridge === true;
|
||||||
this.callerId = this.data.callerId;
|
this.callerId = this.data.callerId;
|
||||||
|
this.callerName = this.data.callerName;
|
||||||
this.dialMusic = this.data.dialMusic;
|
this.dialMusic = this.data.dialMusic;
|
||||||
this.headers = this.data.headers || {};
|
this.headers = this.data.headers || {};
|
||||||
this.method = this.data.method || 'POST';
|
this.method = this.data.method || 'POST';
|
||||||
@@ -415,7 +416,8 @@ class TaskDial extends Task {
|
|||||||
const opts = {
|
const opts = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
proxy: `sip:${sbcAddress}`,
|
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');
|
const t = this.target.find((t) => t.type === 'teams');
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class TaskRestDial extends Task {
|
|||||||
super(logger, opts);
|
super(logger, opts);
|
||||||
|
|
||||||
this.from = this.data.from;
|
this.from = this.data.from;
|
||||||
|
this.callerName = this.data.callerName;
|
||||||
this.fromHost = this.data.fromHost;
|
this.fromHost = this.data.fromHost;
|
||||||
this.to = this.data.to;
|
this.to = this.data.to;
|
||||||
this.call_hook = this.data.call_hook;
|
this.call_hook = this.data.call_hook;
|
||||||
|
|||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -15,7 +15,7 @@
|
|||||||
"@jambonz/speech-utils": "^0.0.12",
|
"@jambonz/speech-utils": "^0.0.12",
|
||||||
"@jambonz/stats-collector": "^0.1.8",
|
"@jambonz/stats-collector": "^0.1.8",
|
||||||
"@jambonz/time-series": "^0.2.5",
|
"@jambonz/time-series": "^0.2.5",
|
||||||
"@jambonz/verb-specifications": "^0.0.12",
|
"@jambonz/verb-specifications": "^0.0.14",
|
||||||
"@opentelemetry/api": "^1.4.0",
|
"@opentelemetry/api": "^1.4.0",
|
||||||
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
||||||
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
||||||
@@ -1664,9 +1664,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@jambonz/verb-specifications": {
|
"node_modules/@jambonz/verb-specifications": {
|
||||||
"version": "0.0.12",
|
"version": "0.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.14.tgz",
|
||||||
"integrity": "sha512-NU+9iVCqyn8GI/QG1gKhBb9h9poEIAxfydFdDOpXOXcT4nlwuT/RLM+6X2wJcysqcc2hA/4aPhk0lMnw0H6ejg==",
|
"integrity": "sha512-yT7I8PmBgmt+GTCno4F5ryL4CQrgIVsE2YUfVjCMg09pjnrumdKVqArFXW8KZsNzbCKjhVTtQE60kJd6gWCQfg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"pino": "^8.8.0"
|
"pino": "^8.8.0"
|
||||||
@@ -10011,9 +10011,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@jambonz/verb-specifications": {
|
"@jambonz/verb-specifications": {
|
||||||
"version": "0.0.12",
|
"version": "0.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.14.tgz",
|
||||||
"integrity": "sha512-NU+9iVCqyn8GI/QG1gKhBb9h9poEIAxfydFdDOpXOXcT4nlwuT/RLM+6X2wJcysqcc2hA/4aPhk0lMnw0H6ejg==",
|
"integrity": "sha512-yT7I8PmBgmt+GTCno4F5ryL4CQrgIVsE2YUfVjCMg09pjnrumdKVqArFXW8KZsNzbCKjhVTtQE60kJd6gWCQfg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"pino": "^8.8.0"
|
"pino": "^8.8.0"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
"@jambonz/speech-utils": "^0.0.12",
|
"@jambonz/speech-utils": "^0.0.12",
|
||||||
"@jambonz/stats-collector": "^0.1.8",
|
"@jambonz/stats-collector": "^0.1.8",
|
||||||
"@jambonz/time-series": "^0.2.5",
|
"@jambonz/time-series": "^0.2.5",
|
||||||
"@jambonz/verb-specifications": "^0.0.12",
|
"@jambonz/verb-specifications": "^0.0.14",
|
||||||
"@opentelemetry/api": "^1.4.0",
|
"@opentelemetry/api": "^1.4.0",
|
||||||
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
"@opentelemetry/exporter-jaeger": "^1.9.0",
|
||||||
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ test('\'dial-phone\'', async(t) => {
|
|||||||
{
|
{
|
||||||
"verb": "dial",
|
"verb": "dial",
|
||||||
"callerId": from,
|
"callerId": from,
|
||||||
|
"callerName": "test_callerName",
|
||||||
"actionHook": "/actionHook",
|
"actionHook": "/actionHook",
|
||||||
"timeLimit": 5,
|
"timeLimit": 5,
|
||||||
"target": [
|
"target": [
|
||||||
@@ -56,6 +57,7 @@ test('\'dial-phone\'', async(t) => {
|
|||||||
"method": "POST",
|
"method": "POST",
|
||||||
},
|
},
|
||||||
"from": from,
|
"from": from,
|
||||||
|
"callerName": "Tom",
|
||||||
"to": {
|
"to": {
|
||||||
"type": "phone",
|
"type": "phone",
|
||||||
"number": "15583084808"
|
"number": "15583084808"
|
||||||
|
|||||||
Reference in New Issue
Block a user