mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-01-25 02:07:56 +00:00
Compare commits
7 Commits
fix/1413
...
feat/metad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fb5bb6848 | ||
|
|
2d7d84436a | ||
|
|
e99260acd0 | ||
|
|
522469ca89 | ||
|
|
4f486b2c0a | ||
|
|
906db6e340 | ||
|
|
252ad2d07f |
@@ -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,
|
||||
|
||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -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.17",
|
||||
"@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",
|
||||
@@ -1664,9 +1664,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jambonz/verb-specifications": {
|
||||
"version": "0.0.17",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.17.tgz",
|
||||
"integrity": "sha512-tYi6rKShNhU/pXc/ZaEeTYfdv5LXmRaGWfdcN499IiGqMnAFZ/0p0HYgOoSsupn90hlquFsy4eyg+41hxherTw==",
|
||||
"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"
|
||||
@@ -10011,9 +10011,9 @@
|
||||
}
|
||||
},
|
||||
"@jambonz/verb-specifications": {
|
||||
"version": "0.0.17",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.17.tgz",
|
||||
"integrity": "sha512-tYi6rKShNhU/pXc/ZaEeTYfdv5LXmRaGWfdcN499IiGqMnAFZ/0p0HYgOoSsupn90hlquFsy4eyg+41hxherTw==",
|
||||
"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"
|
||||
|
||||
@@ -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.17",
|
||||
"@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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user