Compare commits

..

8 Commits

Author SHA1 Message Date
Quan HL
8fb5bb6848 fix failing testcase 2023-05-07 19:07:00 +07:00
Quan HL
2d7d84436a fix failing testcase 2023-05-07 17:33:29 +07:00
Quan HL
e99260acd0 fix failing testcase 2023-05-07 17:32:25 +07:00
Quan HL
522469ca89 fix failing testcase 2023-05-07 17:25:13 +07:00
Quan HL
4f486b2c0a fix type 2023-05-07 09:49:24 +07:00
Quan HL
906db6e340 fix: update verb specification version 2023-05-07 09:40:52 +07:00
Quan HL
252ad2d07f feat: add metadata to create call as tag 2023-05-07 06:59:35 +07:00
Hoan Luu Huu
9948592080 feat: update verb specification version (#330) 2023-04-28 08:44:10 -04:00
4 changed files with 73 additions and 23 deletions

View File

@@ -193,7 +193,7 @@ router.post('/', async(req, res) => {
direction: CallDirection.Outbound,
req: inviteReq,
to,
tag: app.tag,
tag: {...req.body.metadata, ...app.tag},
callSid,
accountSid: req.body.account_sid,
applicationSid: app.application_sid,

63
package-lock.json generated
View File

@@ -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.16",
"@jambonz/verb-specifications": "^0.0.18",
"@opentelemetry/api": "^1.4.0",
"@opentelemetry/exporter-jaeger": "^1.9.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
@@ -25,7 +25,7 @@
"@opentelemetry/sdk-trace-base": "^1.9.0",
"@opentelemetry/sdk-trace-node": "^1.9.0",
"@opentelemetry/semantic-conventions": "^1.9.0",
"aws-sdk": "^2.1354.0",
"aws-sdk": "^2.1313.0",
"bent": "^7.3.12",
"debug": "^4.3.4",
"deepcopy": "^2.1.0",
@@ -1664,9 +1664,9 @@
}
},
"node_modules/@jambonz/verb-specifications": {
"version": "0.0.16",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.16.tgz",
"integrity": "sha512-2ZHpbBmqhRT9a4Cs8HEQncvdp1zS7MbzLsFynVu3gSpvgfeepRtqWX8rxG9VF9Mr+AbJoeCfo+MO0PyJCPWTMA==",
"version": "0.0.18",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.18.tgz",
"integrity": "sha512-/yIxd3qdFVCNiTnyGm/r0sChDHptDEt2oIJlcAcFuDFbh2xttQYCVeQ75B3d/FhLHlfB82xskmP6lolEAm9gNg==",
"dependencies": {
"debug": "^4.3.4",
"pino": "^8.8.0"
@@ -2474,9 +2474,9 @@
}
},
"node_modules/aws-sdk": {
"version": "2.1354.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz",
"integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==",
"version": "2.1313.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1313.0.tgz",
"integrity": "sha512-8GMdtV2Uch3HL2c6+P3lNZFTcg/fqq9L3EWYRLb6ljCZvWKTssjdkjSJFDyTReNgeiKV224YRPYQbKpOEz4flQ==",
"dependencies": {
"buffer": "4.9.2",
"events": "1.1.1",
@@ -2487,7 +2487,7 @@
"url": "0.10.3",
"util": "^0.12.4",
"uuid": "8.0.0",
"xml2js": "0.5.0"
"xml2js": "0.4.19"
},
"engines": {
"node": ">= 10.0.0"
@@ -2501,6 +2501,23 @@
"uuid": "dist/bin/uuid"
}
},
"node_modules/aws-sdk/node_modules/xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"dependencies": {
"sax": ">=0.6.0",
"xmlbuilder": "~9.0.1"
}
},
"node_modules/aws-sdk/node_modules/xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ==",
"engines": {
"node": ">=4.0"
}
},
"node_modules/axios": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.2.1.tgz",
@@ -9994,9 +10011,9 @@
}
},
"@jambonz/verb-specifications": {
"version": "0.0.16",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.16.tgz",
"integrity": "sha512-2ZHpbBmqhRT9a4Cs8HEQncvdp1zS7MbzLsFynVu3gSpvgfeepRtqWX8rxG9VF9Mr+AbJoeCfo+MO0PyJCPWTMA==",
"version": "0.0.18",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.18.tgz",
"integrity": "sha512-/yIxd3qdFVCNiTnyGm/r0sChDHptDEt2oIJlcAcFuDFbh2xttQYCVeQ75B3d/FhLHlfB82xskmP6lolEAm9gNg==",
"requires": {
"debug": "^4.3.4",
"pino": "^8.8.0"
@@ -10628,9 +10645,9 @@
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw=="
},
"aws-sdk": {
"version": "2.1354.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz",
"integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==",
"version": "2.1313.0",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1313.0.tgz",
"integrity": "sha512-8GMdtV2Uch3HL2c6+P3lNZFTcg/fqq9L3EWYRLb6ljCZvWKTssjdkjSJFDyTReNgeiKV224YRPYQbKpOEz4flQ==",
"requires": {
"buffer": "4.9.2",
"events": "1.1.1",
@@ -10641,13 +10658,27 @@
"url": "0.10.3",
"util": "^0.12.4",
"uuid": "8.0.0",
"xml2js": "0.5.0"
"xml2js": "0.4.19"
},
"dependencies": {
"uuid": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz",
"integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw=="
},
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"requires": {
"sax": ">=0.6.0",
"xmlbuilder": "~9.0.1"
}
},
"xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ=="
}
}
},

View File

@@ -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.16",
"@jambonz/verb-specifications": "^0.0.18",
"@opentelemetry/api": "^1.4.0",
"@opentelemetry/exporter-jaeger": "^1.9.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
@@ -41,7 +41,7 @@
"@opentelemetry/sdk-trace-base": "^1.9.0",
"@opentelemetry/sdk-trace-node": "^1.9.0",
"@opentelemetry/semantic-conventions": "^1.9.0",
"aws-sdk": "^2.1354.0",
"aws-sdk": "^2.1313.0",
"bent": "^7.3.12",
"debug": "^4.3.4",
"deepcopy": "^2.1.0",

View File

@@ -80,10 +80,18 @@ test('test create-call call-hook basic authentication', async(t) => {
"username": "username",
"password": "password"
},
call_status_hook: {
url: "http://127.0.0.1:3100/callStatus",
method: "POST",
},
"from": from,
"to": {
"type": "phone",
"number": "15583084809"
},
metadata: {
customer: "acme",
referenceId: "deadbeef"
}});
let verbs = [
@@ -96,13 +104,24 @@ test('test create-call call-hook basic authentication', async(t) => {
//THEN
await p;
let obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}`)
t.ok(obj.headers.Authorization = 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=',
'create-call: call-hook contains basic authentication header');
let obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}`);
t.ok(
obj.headers.Authorization === "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
"create-call: call-hook contains basic authentication header"
);
t.ok(
obj.body.customerdata.customer === "acme",
"create-call: metadata is working"
);
obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}_callStatus`);
t.ok(
obj.body.customerData.customer === "acme",
"create-call: metadata is working"
);
disconnect();
} catch (err) {
console.log(`error received: ${err}`);
disconnect();
t.error(err);
}
});
});