mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 00:58:34 +00:00
* feat: add create-call timeout test * feat: single webhook-test-scaffold and basic auth callhook testcase * cleanup Co-authored-by: Quan Luu <quan.luuhoang8@gmail.com> Co-authored-by: xquanluu <110280845+xquanluu@users.noreply.github.com>
19 lines
557 B
JavaScript
19 lines
557 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);
|
|
}
|
|
|
|
module.exports = provisionCallHook
|