From a7a9bffbfa1132f33a1b8c4122c15987801b0c1c Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 24 Jul 2024 07:08:49 -0400 Subject: [PATCH] wip --- lib/call-session.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/call-session.js b/lib/call-session.js index 1bfd51c..737e713 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -428,6 +428,7 @@ class CallSession extends Emitter { /* only now can we set Contact & From header since they depend on transport and scheme of gw */ const gw = mapGateways.get(uri); if (gw) { + const {scheme, transport} = gw; this.logger.info({gw}, `sending INVITE to ${uri} via carrier ${gw.name}`); hdrs = { ...hdrs, @@ -436,22 +437,22 @@ class CallSession extends Emitter { logger: this.logger, req: this.req, register_from_domain: gw.register_from_domain, - scheme: gw.scheme, - transport: gw.transport, + scheme, + transport, ...(private_network && {host: this.privateSipAddress}) }) : createBLegFromHeader({ logger: this.logger, req: this.req, - scheme: gw.scheme, - transport: gw.transport, + scheme, + transport, ...(private_network && {host: this.privateSipAddress}) }), Contact: createBLegFromHeader({ logger: this.logger, req: this.req, - scheme: gw.scheme, - transport: gw.transport, + scheme, + transport, ...(private_network && {host: this.privateSipAddress}) }), ...(gw.diversion && {