From 72f8644be491b805e805fd16e25709a5b8187584 Mon Sep 17 00:00:00 2001 From: Stuart Gros-Dubois Date: Thu, 4 Dec 2025 15:11:51 +0100 Subject: [PATCH] Improve SIP IPv6 handling by removing scope identifier in host Modified SIP host assignment to remove scope identifier and updated comment to clarify --- src/gov/nist/javax/sip/address/AddressFactoryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gov/nist/javax/sip/address/AddressFactoryImpl.java b/src/gov/nist/javax/sip/address/AddressFactoryImpl.java index c28addc95..61f40e892 100755 --- a/src/gov/nist/javax/sip/address/AddressFactoryImpl.java +++ b/src/gov/nist/javax/sip/address/AddressFactoryImpl.java @@ -158,10 +158,10 @@ public javax.sip.address.SipURI createSipURI(String user, String host) throws Pa uriString.append("@"); } - //if host is an IPv6 string we should enclose it in sq brackets + //if host is an IPv6 string we should enclose it in sq brackets and remove the scope identifier if (host.indexOf(':') != host.lastIndexOf(':') && host.trim().charAt(0) != '[') - host = '[' + host + ']'; + host = '[' + host.split("%")[0] + ']'; uriString.append(host);