fix: missing token update and missing return (#435)

This commit is contained in:
Anton Voylenko
2025-05-07 21:14:40 +03:00
committed by GitHub
parent 561de0532f
commit 217c11a5e1

View File

@@ -1048,6 +1048,7 @@ const updateCall = async(req, res) => {
await validateRequest(req, accountSid);
const callSid = parseCallSid(req);
validateUpdateCall(req.body);
updateLastUsed(logger, accountSid, req).catch((err) => {});
const call = await retrieveCall(accountSid, callSid);
if (call) {
const url = `${call.serviceUrl}/${process.env.JAMBONES_API_VERSION || 'v1'}/updateCall/${callSid}`;
@@ -1071,7 +1072,6 @@ const updateCall = async(req, res) => {
logger.debug(`updateCall: call not found for call sid ${callSid}`);
res.sendStatus(404);
}
updateLastUsed(logger, accountSid, req).catch((err) => {});
} catch (err) {
sysError(logger, res, err);
}
@@ -1098,7 +1098,9 @@ router.post('/:sid/Messages', async(req, res) => {
const setName = `${(process.env.JAMBONES_CLUSTER_ID || 'default')}:fs-service-url`;
const serviceUrl = await getFsUrl(logger, retrieveSet, setName);
if (!serviceUrl) res.json({msg: 'no available feature servers at this time'}).status(480);
if (!serviceUrl) {
return res.status(480).json({msg: 'no available feature servers at this time'});
}
await validateCreateMessage(logger, account_sid, req);
const payload = {