fix: use sips scheme in From/Contact when forwarding to a sips Request-URI

RFC 3261 8.1.1.8 requires a SIPS Contact when the Request-URI is SIPS.
The forward path (dial verb to a sip target) always defaulted to sip:.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dave Horton
2026-10-06 11:28:25 -04:00
co-authored by Claude Opus 5.5
parent c596efc8db
commit 0738c58f76
+4
View File
@@ -505,17 +505,21 @@ class CallSession extends Emitter {
}
else {
const uri = parseUri(this.req.uri);
/* RFC 3261 8.1.1.8: a sips Request-URI requires a sips Contact */
const scheme = uri.scheme === 'sips' ? 'sips' : 'sip';
hdrs = {
...hdrs,
'From': createBLegFromHeader({
logger: this.logger,
req: this.req,
scheme,
transport: uri.params.transport,
...(private_network && {host: this.privateSipAddress})
}),
'Contact': createBLegFromHeader({
logger: this.logger,
req: this.req,
scheme,
transport: uri.params.transport,
...(private_network && {host: this.privateSipAddress})
})