mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-14 10:19:07 +00:00
Simplify test (#145)
* 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>
This commit is contained in:
@@ -17,10 +17,25 @@ function connect(connectable) {
|
||||
test('basic webhook tests', async(t) => {
|
||||
clearModule.all();
|
||||
const {srf, disconnect} = require('../app');
|
||||
const provisionCallHook = require('./utils')
|
||||
|
||||
try {
|
||||
await connect(srf);
|
||||
await sippUac('uac-expect-603.xml', '172.38.0.10');
|
||||
const verbs = [
|
||||
{
|
||||
verb: 'sip:decline',
|
||||
status: 603,
|
||||
reason: 'Gone Fishin',
|
||||
headers: {
|
||||
'Retry-After': 300
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
const from = 'sip_decline_test_success';
|
||||
provisionCallHook(from, verbs)
|
||||
|
||||
await sippUac('uac-expect-603.xml', '172.38.0.10', from);
|
||||
t.pass('webhook successfully declines call');
|
||||
|
||||
disconnect();
|
||||
|
||||
Reference in New Issue
Block a user