mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
update call uses a PUT now, not POST
This commit is contained in:
@@ -32,10 +32,7 @@ function retrieveCallSession(callSid, opts) {
|
|||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
const updateCall = async(req, res) => {
|
||||||
* update a call
|
|
||||||
*/
|
|
||||||
router.post('/:callSid', async(req, res) => {
|
|
||||||
const logger = req.app.locals.logger;
|
const logger = req.app.locals.logger;
|
||||||
const callSid = req.params.callSid;
|
const callSid = req.params.callSid;
|
||||||
logger.debug({body: req.body}, 'got upateCall request');
|
logger.debug({body: req.body}, 'got upateCall request');
|
||||||
@@ -45,11 +42,23 @@ router.post('/:callSid', async(req, res) => {
|
|||||||
logger.info(`updateCall: callSid not found ${callSid}`);
|
logger.info(`updateCall: callSid not found ${callSid}`);
|
||||||
return res.sendStatus(404);
|
return res.sendStatus(404);
|
||||||
}
|
}
|
||||||
res.sendStatus(202);
|
res.sendStatus(204);
|
||||||
cs.updateCall(req.body, callSid);
|
cs.updateCall(req.body, callSid);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
sysError(logger, res, 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;
|
module.exports = router;
|
||||||
|
|||||||
Reference in New Issue
Block a user