diff --git a/lib/call-session.js b/lib/call-session.js index f503d37..ee1cd14 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -7,7 +7,7 @@ const {SipError, stringifyUri, parseUri} = require('drachtio-srf'); const debug = require('debug')('jambonz:sbc-outbound'); const makeInviteInProgressKey = (callid) => `sbc-out-iip${callid}`; -const IMMUTABLE_HEADERS = ['via', 'from', 'to', 'call-id', 'cseq', 'max-forwards', 'content-length']; +const IMMUTABLE_HEADERS = ['via', 'from', 'to', 'call-id', 'cseq', 'max-forwards', 'content-length', 'contact']; /** * this is to make sure the outgoing From has the number in the incoming From * and not the incoming PAI @@ -16,6 +16,7 @@ const createBLegFromHeader = (req, teams, register_from_domain = null) => { const from = req.getParsedHeader('From'); const uri = parseUri(from.uri); let user = uri.user || 'anonymous'; + this.scheme = uri.scheme; let host = 'localhost'; if (teams) { host = req.get('X-MS-Teams-Tenant-FQDN'); @@ -1057,8 +1058,6 @@ Duration=${payload.duration} ` if (farEnd.params?.transport) { this.transport = `transport=${farEnd.params.transport}`; } - /* TODO: we receive a lowercase 'contact' from feature-server */ - delete customHeaders['contact']; this.referContactHeader = `<${this.scheme}:${uri.user}@${uri.host}:${uri.port}>;${this.transport}`; const response = await this.uac.request({