only send Sips if it's enabled in outbound gateway configuration (#136)

* only send Sips if it's enabled in outbound gateway configuration

* update license
This commit is contained in:
Hoan Luu Huu
2024-06-15 20:12:02 +07:00
committed by GitHub
parent 9ad7dc76c7
commit 73e3779eb1
3 changed files with 63 additions and 7 deletions
+4 -1
View File
@@ -300,7 +300,10 @@ class CallSession extends Emitter {
const hostport = !o.port || 5060 === o.port ? o.ipv4 : `${o.ipv4}:${o.port}`;
const prependPlus = vc.e164_leading_plus && !this.req.calledNumber.startsWith('0') ? '+' : '';
const transport = `transport=${protocol}`;
const scheme = (protocol === 'tls' && !process.env.JAMBONES_USE_BEST_EFFORT_TLS) ? 'sips' : 'sip';
const useSipsScheme = protocol === 'tls' &&
!process.env.JAMBONES_USE_BEST_EFFORT_TLS &&
o.use_sips_scheme;
const scheme = useSipsScheme ? 'sips' : 'sip';
const u = `${scheme}:${prefix}${prependPlus}${calledNumber}@${hostport};${transport}`;
const obj = {
name: vc.name,