mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
* feat: update time-series 0.11.12 * feat: support play verb url in plain text or array * fix: review comment Co-authored-by: Dave Horton <daveh@beachdognet.com>
28 lines
806 B
JavaScript
28 lines
806 B
JavaScript
const bent = require('bent');
|
|
|
|
/*
|
|
* phoneNumber: 16174000000
|
|
* Hook endpoints http://127.0.0.1:3100/
|
|
* The function help testcase to register desired jambonz json response for an application call
|
|
* When a call has From number match the registered hook event, the desired jambonz json will be responded.
|
|
*/
|
|
const provisionCallHook = (from, verbs) => {
|
|
const mapping = {
|
|
from,
|
|
data: JSON.stringify(verbs)
|
|
};
|
|
const post = bent('http://127.0.0.1:3100', 'POST', 'string', 200);
|
|
post('/appMapping', mapping);
|
|
}
|
|
|
|
const provisionCustomHook = (from, verbs) => {
|
|
const mapping = {
|
|
from,
|
|
data: JSON.stringify(verbs)
|
|
};
|
|
const post = bent('http://127.0.0.1:3100', 'POST', 'string', 200);
|
|
post(`/customHookMapping`, mapping);
|
|
}
|
|
|
|
module.exports = { provisionCallHook, provisionCustomHook}
|