added quotes around in the sql query (#54)

Co-authored-by: Joan Salvatella <joan@bookline.io>
This commit is contained in:
Joan
2022-10-08 12:33:27 +02:00
committed by GitHub
parent 7b085e5763
commit 363eb676a3

View File

@@ -139,7 +139,7 @@ module.exports = (srf, logger) => {
/* we have one or more carriers that match. Now we need to find one with a provisioned phone number */
const vc_sids = matches.map((m) => `'${m.voip_carrier_sid}'`).join(',');
const did = normalizeDID(req.calledNumber);
const sql = `SELECT * FROM phone_numbers WHERE number = ${did} AND voip_carrier_sid IN (${vc_sids})`;
const sql = `SELECT * FROM phone_numbers WHERE number = '${did}' AND voip_carrier_sid IN (${vc_sids})`;
logger.debug({matches, sql, did, vc_sids}, 'looking up DID');
const [r] = await pp.query(sql);