mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-01-24 22:37:51 +00:00
fix for #163
This commit is contained in:
@@ -68,6 +68,8 @@ class CallSession extends Emitter {
|
||||
this.service_provider_sid = req.locals.service_provider_sid;
|
||||
this.srsClients = [];
|
||||
this.recordingNoAnswerTimeout = (process.env.JAMBONES_RECORDING_NO_ANSWER_TIMEOUT || 2) * 1000;
|
||||
|
||||
this.isUsingPrivateNetwork = isPrivateVoipNetwork(this.req.source_address);
|
||||
}
|
||||
|
||||
get isFromMSTeams() {
|
||||
@@ -187,7 +189,7 @@ class CallSession extends Emitter {
|
||||
...this.rtpEngineOpts.common,
|
||||
...this.rtpEngineOpts.uac.mediaOpts,
|
||||
'from-tag': this.rtpEngineOpts.uas.tag,
|
||||
direction: [isPrivateVoipNetwork(this.req.source_address) ? 'private' : 'public', 'private'],
|
||||
direction: [this.isUsingPrivateNetwork ? 'private' : 'public', 'private'],
|
||||
sdp
|
||||
};
|
||||
const startAt = process.hrtime();
|
||||
@@ -224,7 +226,7 @@ class CallSession extends Emitter {
|
||||
|
||||
// set Contact header based on scenario, and transport protocol
|
||||
let responseHeaders = {};
|
||||
if (isPrivateVoipNetwork(this.req.source_address)) {
|
||||
if (this.isUsingPrivateNetwork) {
|
||||
this.contactHeader = `<${scheme}:${this.privateSipAddress};transport=${this.req.protocol}>`;
|
||||
responseHeaders = {
|
||||
...responseHeaders,
|
||||
@@ -998,11 +1000,15 @@ Duration=${payload.duration} `
|
||||
...customHeaders
|
||||
} = req.headers;
|
||||
|
||||
if (this.isUsingPrivateNetwork && this.privateSipAddress) {
|
||||
u.host = this.privateSipAddress;
|
||||
}
|
||||
const response = await this.uas.request({
|
||||
method: 'REFER',
|
||||
headers: {
|
||||
'Refer-To': `<${stringifyUri(uri)}>`,
|
||||
'Referred-By': `<${stringifyUri(u)}>`,
|
||||
...(this.contactHeader && {'Contact': this.contactHeader}),
|
||||
...customHeaders
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user