RestComm / jain-sip

Disclaimer: This repository is a git-svn mirror of the project found at http://java.net/projects/jsip whose original repository is developed collaboratively by the Advanced Networking Technologies Division at the National Institute of Standards and Technology (NIST) - an agency of the United States Department of Commerce and by a community of individual and enterprise contributors. TeleStax, Inc. will perform some productization work, new features experimentation branches, etc for its TelScale jSIP product that doesn't concern the community from the main repository hence this git repository.
http://www.restcomm.com/
141 stars 151 forks source link

Reserved characters in SIP URIs are not escaped #171

Open xhoaluu opened 6 years ago

xhoaluu commented 6 years ago

And JSR 289 (section 4.2.1) says: "Likewise, string values passed to setters for various SIP/SIPS URI components may contain reserved or excluded characters that need escaping before being used. The container is responsible for escaping those values as necessary."

But when we run the following code:

SipURI uri = (SipURI)sipFactory.createURI("sip:alice@ex.com"); uri.setHeader("email", "alice@priv.com"); mLogger.debug("4) uri="+uri);

it prints:

4) uri=sip:alice@ex.com?email=alice@priv.com

The correct result would have been: uri=sip:alice@ex.com?email=alice%40priv.com