mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-07-24 12:51:55 +00:00
revamp to mysql for gateway configuration and major code refactor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user