From 0738c58f76896ca2d6f16f9efc792e422d21a59a Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 1 Oct 2026 23:58:47 -0400 Subject: [PATCH] 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 --- lib/call-session.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/call-session.js b/lib/call-session.js index 355e174..2bcaecb 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -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}) })