mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-03-21 18:57:56 +00:00
remove ice and dtls off (#214)
* remove ice and dtls off if set in db * lint * more lint
This commit is contained in:
@@ -352,7 +352,8 @@ class CallSession extends Emitter {
|
|||||||
* like a rare use case -- encryption is usually an all or nothing requirement.
|
* like a rare use case -- encryption is usually an all or nothing requirement.
|
||||||
*/
|
*/
|
||||||
this.logger.info({u}, `using SRTP for outbound call, pad crypto: ${o.pad_crypto ? 'yes' : 'no'}`);
|
this.logger.info({u}, `using SRTP for outbound call, pad crypto: ${o.pad_crypto ? 'yes' : 'no'}`);
|
||||||
this.rtpEngineOpts = makeRtpEngineOpts(this.req, false, true, o.pad_crypto, true);
|
// eslint-disable-next-line max-len
|
||||||
|
this.rtpEngineOpts = makeRtpEngineOpts(this.req, false, true, o.pad_crypto, true, o.remove_ice, o.dtls_off);
|
||||||
encryptedMedia = true;
|
encryptedMedia = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
11
lib/utils.js
11
lib/utils.js
@@ -5,7 +5,8 @@ const CIDRMatcher = require('cidr-matcher');
|
|||||||
const dns = require('dns');
|
const dns = require('dns');
|
||||||
const sdpTransform = require('sdp-transform');
|
const sdpTransform = require('sdp-transform');
|
||||||
|
|
||||||
function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, padCrypto, teams) {
|
// eslint-disable-next-line max-len
|
||||||
|
function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, padCrypto, teams, remove_ice = false, dtls_off = false) {
|
||||||
const from = req.getParsedHeader('from');
|
const from = req.getParsedHeader('from');
|
||||||
const rtpCopy = JSON.parse(JSON.stringify(rtpCharacteristics));
|
const rtpCopy = JSON.parse(JSON.stringify(rtpCharacteristics));
|
||||||
const srtpCopy = JSON.parse(JSON.stringify(srtpCharacteristics));
|
const srtpCopy = JSON.parse(JSON.stringify(srtpCharacteristics));
|
||||||
@@ -16,6 +17,14 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, padCrypto, teams
|
|||||||
}
|
}
|
||||||
|
|
||||||
const srtpOpts = teams ? srtpCopy['teams'] : srtpCopy['default'];
|
const srtpOpts = teams ? srtpCopy['teams'] : srtpCopy['default'];
|
||||||
|
|
||||||
|
if (remove_ice) {
|
||||||
|
srtpOpts.ICE = 'remove';
|
||||||
|
}
|
||||||
|
if (dtls_off) {
|
||||||
|
srtpOpts.DTLS = 'off';
|
||||||
|
}
|
||||||
|
|
||||||
const dstOpts = JSON.parse(JSON.stringify(dstIsUsingSrtp ? srtpOpts : rtpCopy));
|
const dstOpts = JSON.parse(JSON.stringify(dstIsUsingSrtp ? srtpOpts : rtpCopy));
|
||||||
const srcOpts = JSON.parse(JSON.stringify(srcIsUsingSrtp ? srtpOpts : rtpCopy));
|
const srcOpts = JSON.parse(JSON.stringify(srcIsUsingSrtp ? srtpOpts : rtpCopy));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user