when sending to retell with user starting with call_ dont prepend plus (#191)

This commit is contained in:
Dave Horton
2025-09-03 23:35:56 -04:00
committed by GitHub
parent c87f831868
commit 2fc570f731

View File

@@ -322,7 +322,7 @@ class CallSession extends Emitter {
const prefix = vc.tech_prefix || ''; const prefix = vc.tech_prefix || '';
const transport = o.protocol?.startsWith('tls') ? 'tls' : (o.protocol || 'udp'); const transport = o.protocol?.startsWith('tls') ? 'tls' : (o.protocol || 'udp');
const hostport = !o.port || 5060 === o.port ? o.ipv4 : `${o.ipv4}:${o.port}`; 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 prependPlus = vc.e164_leading_plus && /^[1-9]/.test(this.req.calledNumber) ? '+' : '';
const scheme = transport === 'tls' && !process.env.JAMBONES_USE_BEST_EFFORT_TLS && o.use_sips_scheme ? const scheme = transport === 'tls' && !process.env.JAMBONES_USE_BEST_EFFORT_TLS && o.use_sips_scheme ?
'sips' : 'sip'; 'sips' : 'sip';
let u = `${scheme}:${prefix}${prependPlus}${calledNumber}@${hostport};transport=${transport}`; let u = `${scheme}:${prefix}${prependPlus}${calledNumber}@${hostport};transport=${transport}`;