merge features from hosted branch (#32)

major merge of features from the hosted branch that was created temporarily during the initial launch of jambonz.org
This commit is contained in:
Dave Horton
2021-06-17 16:25:50 -04:00
committed by GitHub
parent 473a34ec9f
commit 9b59d08dcf
68 changed files with 3436 additions and 1066 deletions

View File

@@ -32,7 +32,10 @@ function retrieveCallSession(callSid, opts) {
return cs;
}
const updateCall = async(req, res) => {
/**
* update a call
*/
router.post('/:callSid', async(req, res) => {
const logger = req.app.locals.logger;
const callSid = req.params.callSid;
logger.debug({body: req.body}, 'got upateCall request');
@@ -42,23 +45,11 @@ const updateCall = async(req, res) => {
logger.info(`updateCall: callSid not found ${callSid}`);
return res.sendStatus(404);
}
res.sendStatus(204);
res.sendStatus(202);
cs.updateCall(req.body, callSid);
} catch (err) {
sysError(logger, res, err);
}
};
/**
* update a call
*/
/* leaving in for legacy; should have been (and now is) a PUT */
router.post('/:callSid', async(req, res) => {
await updateCall(req, res);
});
router.put('/:callSid', async(req, res) => {
await updateCall(req, res);
});
module.exports = router;