hungkhang / sipservlets

Automatically exported from code.google.com/p/sipservlets
0 stars 0 forks source link

URL decoding on Contact header feature parameters #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. SIP client sends OPTIONS request including URL encoded GSMA RCS feature tags 
as Contact header feature parameters (e.g. 
+g.3gpp.iari-ref="urn%3Aurn-7%3A3gpp-application.ims.iari.rcse.im,urn%3Aurn-7%3A
3gpp-application.ims.iari.rcse.ft")

2. Our SIP Servlet application acts as B2BUA, creates a new OPTIONS request and 
adds features from original request without modification (still URL encoded) 
using:
  Address contactHeader = message.getAddressHeader("Contact");
  for (...) {
    contactHeader.setParameter(tag, value);
  }

3. Mobicents sends the request

What is the expected output? What do you see instead?
Expected: 
+g.3gpp.iari-ref="urn%3Aurn-7%3A3gpp-application.ims.iari.rcse.im,urn%3Aurn-7%3A
3gpp-application.ims.iari.rcse.ft"
Actual: 
+g.3gpp.iari-ref="urn:urn-7:3gpp-application.ims.iari.rcse.im,urn:urn-7:3gpp-app
lication.ims.iari.rcse.ft"

What version of the product are you using? On what operating system?
MSS 3.0.0 SNAPSHOT on Tomcat 7

Please provide any additional information below.
According to RFC 3840, section 9 
(http://tools.ietf.org/html/rfc3840#section-9), tag-values in tag-value-lists 
have the form:

token-nobang = 1*(alphanum / "-" / "." / "%" / "*" / "_" / "+" / "`" / "'" / 
"~" )

So the ':' is not valid and it is appropriate to URL encode these values. 
However, Mobicents SIP Servlets is automatically decoding them, which causes 
problems as clients may not recognize these features anymore.

Original issue reported on code.google.com by nmcam...@gmail.com on 5 Mar 2014 at 6:59

GoogleCodeExporter commented 9 years ago
Moved to https://github.com/Mobicents/sip-servlets/issues/16

Original comment by jean.deruelle on 17 Dec 2014 at 9:34