Skip to content

Commit 23c7480

Browse files
authored
REFER should have sips contact if far end is using sips (#192)
1 parent 086adfb commit 23c7480

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/call-session.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ class CallSession extends Emitter {
180180
host = obj.host;
181181
proxy = `sip:${featureServer}`;
182182
}
183-
if (obj.user) uri = `${scheme}:${obj.user}@${host}`;
184-
else uri = `${scheme}:${host}`;
183+
if (obj.user) uri = `sip:${obj.user}@${host}`;
184+
else uri = `sip:${host}`;
185185
this.logger.info(`uri will be: ${uri}, proxy ${proxy}`);
186186

187187
const sendOfferToRtpEngine = async(remoteSdp) => {
@@ -1057,7 +1057,7 @@ Duration=${payload.duration} `
10571057
// eslint-disable-next-line no-unused-vars
10581058
'content-length':contentlength, 'refer-to':_referto, 'referred-by': referredby,
10591059
// eslint-disable-next-line no-unused-vars
1060-
'X-Refer-To-Leave-Untouched': _leave,
1060+
'X-Refer-To-Leave-Untouched': _leave, contact: _contact,
10611061
...customHeaders
10621062
} = req.headers;
10631063

@@ -1066,6 +1066,7 @@ Duration=${payload.duration} `
10661066
headers: {
10671067
'Refer-To': `<${stringifyUri(uri)}>`,
10681068
'Referred-By': referredby,
1069+
'Contact': this.contactHeader,
10691070
...customHeaders
10701071
}
10711072
});

0 commit comments

Comments
 (0)