bugfix: 302 response in rest outdial caused restart

This commit is contained in:
Dave Horton
2021-09-27 10:38:49 -04:00
parent beb9c8c81d
commit b9b70debc7

View File

@@ -96,6 +96,9 @@ router.post('/', async(req, res) => {
try {
const dlg = await srf.createUAC(uri, {...opts, followRedirects: true, keepUriOnRedirect: true}, {
cbRequest: (err, inviteReq) => {
/* in case of 302 redirect, this gets called twice, ignore the second */
if (res.headersSent) return;
if (err) {
logger.error(err, 'createCall Error creating call');
res.status(500).send('Call Failure');