mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-10-04 02:04:19 +00:00
add support for tls with srtp media encryption (#83)
This commit is contained in:
+12
-1
@@ -256,7 +256,8 @@ class CallSession extends Emitter {
|
||||
const obj = {
|
||||
name: vc.name,
|
||||
diversion: vc.diversion,
|
||||
hostport
|
||||
hostport,
|
||||
protocol: o.protocol
|
||||
};
|
||||
if (vc.register_username && vc.register_password) {
|
||||
obj.auth = {
|
||||
@@ -266,6 +267,16 @@ class CallSession extends Emitter {
|
||||
}
|
||||
mapGateways.set(u, obj);
|
||||
uris.push(u);
|
||||
if (o.protocol === 'tls/srtp') {
|
||||
/** TODO: this is a bit of a hack in the sense that we are not
|
||||
* supporting a scenario where you have a carrier with several outbound
|
||||
* gateways, some requiring encrypted media and some not. This should be rectified
|
||||
* but it will require more significant changes and right now it seems
|
||||
* like a rare use case -- encryption is usually an all or nothing requirement.
|
||||
*/
|
||||
this.logger.info({u}, 'using SRTP for outbound call');
|
||||
this.rtpEngineOpts = makeRtpEngineOpts(this.req, false, true, true);
|
||||
}
|
||||
});
|
||||
this.logger.debug({uris, voip_carrier_sid}, 'selected outbound gateways for requested carrier');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user