mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-15 02:39:35 +00:00
Compare commits
7 Commits
v0.9.6-rc3
...
feat/metad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fb5bb6848 | ||
|
|
2d7d84436a | ||
|
|
e99260acd0 | ||
|
|
522469ca89 | ||
|
|
4f486b2c0a | ||
|
|
906db6e340 | ||
|
|
252ad2d07f |
@@ -193,7 +193,7 @@ router.post('/', async(req, res) => {
|
|||||||
direction: CallDirection.Outbound,
|
direction: CallDirection.Outbound,
|
||||||
req: inviteReq,
|
req: inviteReq,
|
||||||
to,
|
to,
|
||||||
tag: app.tag,
|
tag: {...req.body.metadata, ...app.tag},
|
||||||
callSid,
|
callSid,
|
||||||
accountSid: req.body.account_sid,
|
accountSid: req.body.account_sid,
|
||||||
applicationSid: app.application_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/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.17",
|
"@jambonz/verb-specifications": "^0.0.18",
|
||||||
"@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.17",
|
"version": "0.0.18",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.17.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.18.tgz",
|
||||||
"integrity": "sha512-tYi6rKShNhU/pXc/ZaEeTYfdv5LXmRaGWfdcN499IiGqMnAFZ/0p0HYgOoSsupn90hlquFsy4eyg+41hxherTw==",
|
"integrity": "sha512-/yIxd3qdFVCNiTnyGm/r0sChDHptDEt2oIJlcAcFuDFbh2xttQYCVeQ75B3d/FhLHlfB82xskmP6lolEAm9gNg==",
|
||||||
"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.17",
|
"version": "0.0.18",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.17.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.18.tgz",
|
||||||
"integrity": "sha512-tYi6rKShNhU/pXc/ZaEeTYfdv5LXmRaGWfdcN499IiGqMnAFZ/0p0HYgOoSsupn90hlquFsy4eyg+41hxherTw==",
|
"integrity": "sha512-/yIxd3qdFVCNiTnyGm/r0sChDHptDEt2oIJlcAcFuDFbh2xttQYCVeQ75B3d/FhLHlfB82xskmP6lolEAm9gNg==",
|
||||||
"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.17",
|
"@jambonz/verb-specifications": "^0.0.18",
|
||||||
"@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",
|
||||||
|
|||||||
@@ -80,10 +80,18 @@ test('test create-call call-hook basic authentication', async(t) => {
|
|||||||
"username": "username",
|
"username": "username",
|
||||||
"password": "password"
|
"password": "password"
|
||||||
},
|
},
|
||||||
|
call_status_hook: {
|
||||||
|
url: "http://127.0.0.1:3100/callStatus",
|
||||||
|
method: "POST",
|
||||||
|
},
|
||||||
"from": from,
|
"from": from,
|
||||||
"to": {
|
"to": {
|
||||||
"type": "phone",
|
"type": "phone",
|
||||||
"number": "15583084809"
|
"number": "15583084809"
|
||||||
|
},
|
||||||
|
metadata: {
|
||||||
|
customer: "acme",
|
||||||
|
referenceId: "deadbeef"
|
||||||
}});
|
}});
|
||||||
|
|
||||||
let verbs = [
|
let verbs = [
|
||||||
@@ -96,13 +104,24 @@ test('test create-call call-hook basic authentication', async(t) => {
|
|||||||
//THEN
|
//THEN
|
||||||
await p;
|
await p;
|
||||||
|
|
||||||
let obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}`)
|
let obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}`);
|
||||||
t.ok(obj.headers.Authorization = 'Basic dXNlcm5hbWU6cGFzc3dvcmQ=',
|
t.ok(
|
||||||
'create-call: call-hook contains basic authentication header');
|
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();
|
disconnect();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(`error received: ${err}`);
|
console.log(`error received: ${err}`);
|
||||||
disconnect();
|
disconnect();
|
||||||
t.error(err);
|
t.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user