diff --git a/lib/http-routes/api/create-call.js b/lib/http-routes/api/create-call.js index a66eef21..bd856c39 100644 --- a/lib/http-routes/api/create-call.js +++ b/lib/http-routes/api/create-call.js @@ -112,6 +112,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');