revamp to mysql for gateway configuration and major code refactor

This commit is contained in:
Dave Horton
2019-12-13 10:20:27 -05:00
parent c22b6f9c08
commit 5a529b2bb9
23 changed files with 1152 additions and 187 deletions
-11
View File
@@ -1,16 +1,6 @@
const config = require('config');
let idx = 0;
function fromInboundTrunk(req) {
const trunks = config.has('trunks.inbound') ?
config.get('trunks.inbound') : [];
if (isWSS(req)) return false;
const trunk = trunks.find((t) => t.host.includes(req.source_address));
if (!trunk) return false;
req.carrier_name = trunk.name;
return true;
}
function isWSS(req) {
return req.getParsedHeader('Via')[0].protocol.toLowerCase().startsWith('ws');
}
@@ -34,7 +24,6 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp) {
}
module.exports = {
fromInboundTrunk,
isWSS,
getAppserver,
makeRtpEngineOpts