< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] Uri escaping


Hi,

 

General question:  How should URIs be escaped?

 

See the attached trace for an example of what we're seeing with resip -- note the Contact header in the NOTIFY, and the subsequent Request-URI in the re-SUBSCRIBE.  Should the URI in the request line be URL-encoded?  (Pouring through the BNF in 3261 leads me to think that it should...)

 

Note that this is a trace from a deployment where the re-SUBSCRIBE actually fails because of the lack of proper escaping.  I tried making the following change in Uri.cxx, and with that in place the re-SUBSCRIBE works.  However I'm not sure if this is correct, or if this is the right spot.  Thoughts?

 

Thanks,

Jeremy

 

// should not encode user parameters unless its a tel?

EncodeStream&

Uri::encodeParsed(EncodeStream& str) const

{

   str << mScheme << Symbols::COLON;

   if (!mUser.empty())

   {

#ifdef HANDLE_CHARACTER_ESCAPING

      //mUser.escapeToStream(str, shouldEscapeUserChar); <== ORIGINAL CODE

      mUser.urlEncode(str);

#else

      str << mUser;

#endif

 

 ... snip ...

 

 

Attachment: UriEscaping.pcap
Description: UriEscaping.pcap