This commit is contained in:
Dave Horton
2020-01-29 16:46:38 -05:00
parent 8487bb0571
commit 44a1b45357
7 changed files with 20 additions and 24 deletions

View File

@@ -83,12 +83,12 @@ module.exports = function(srf, logger) {
baseUrl: `${u.protocol}://${u.resource}${myPort}`,
auth
};
logger.debug({originalRequest: app.originalRequest}, 'invokeWebCallback');
const obj = req.locals.callInfo;
logger.debug({url: call_hook.url, method}, 'invokeWebCallback');
const obj = Object.assign({}, req.locals.callInfo);
// if the call hook is a POST add the entire SIP message to the payload
if (method === 'POST') Object.assign(obj, {sip: req.msg});
app.tasks = await retrieveApp(logger, app.call_hook, method, auth, obj);
if (method === 'POST') obj.sip = req.msg;
app.tasks = await retrieveApp(logger, call_hook.url, method, auth, obj);
next();
} catch (err) {
logger.error(err, 'Error retrieving or parsing application');