Merge pull request #8 from jambonz/fix/create_call_hook

call_hook can be http or ws
This commit is contained in:
Dave Horton
2023-12-19 09:19:28 -05:00
committed by GitHub

View File

@@ -51,7 +51,7 @@ const validateCallCreate = (opts) => {
assert.ok(call_status_hook || !call_hook, 'calls.create: call_status_hook is required when call_hook is used');
const hookUrl = typeof call_hook === 'object' ? call_hook.url : call_hook;
if (hookUrl) assert.ok(/^https?:/.test(hookUrl), 'call_hook must be an absolute url');
if (hookUrl) assert.ok(/^(http|ws)s?:/.test(hookUrl), 'call_hook must be an absolute url');
const hookStatusUrl = typeof call_status_hook === 'object' ? call_status_hook.url : call_status_hook;
if (hookStatusUrl) assert.ok(/^https?:/.test(hookStatusUrl), 'call_status_hook must be an absolute url');
};