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

Re: [reSIProcate] Uri::setUriUserEncoding('#', false);




Scott Godin wrote:

Looks like a bug in the assert statement.  You are asking it not to encode #, 
but you are asserting that # is encoded.


Yes, I deliberately created two test cases:

- the first is meant to test the way reSIProcate used to work before I added this feature, this is the default behaviour

- the second is meant to test the feature

In other words, you shouldn't make any calls to setUriUserEncoding before executing the first test case.

Regards,

Daniel


________________________________

From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx on behalf of Robert 
Mansfield
Sent: Wed 9/27/2006 10:22 AM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] Uri::setUriUserEncoding('#', false);


All,

I've taken a look at this function as I've experienced some interworking issues with carriers that do not encode the '#' character as %23.
I found a code snippit in testUri.cxx. This works ok..

{
Uri uri = Uri("sip:1234#00442031111111@xxxxxxxx");
//cout << "Encoded correctly: " << uri << endl;
assert(Data::from(uri) == "sip:1234%2300442031111111@xxxxxxxx");

Uri::setUriUserEncoding('#', false);
uri = Uri("sip:1234#00442031111111@xxxxxxxx");
//cout << "Non Encoded # for compatibility: " << uri << endl;
assert(Data::from(uri) == "sip:1234#00442031111111@xxxxxxxx");
}

However if I change the code to

{
Uri uri;

Uri::setUriUserEncoding('#', false);
ur= Uri("sip:1234#00442031111111@xxxxxxxx");
//cout << "Encoded correctly: " << uri << endl;
assert(Data::from(uri) == "sip:1234%2300442031111111@xxxxxxxx");

Uri::setUriUserEncoding('#', false);
uri = Uri("sip:1234#00442031111111@xxxxxxxx");
//cout << "Non Encoded # for compatibility: " << uri << endl;
assert(Data::from(uri) == "sip:1234#00442031111111@xxxxxxxx");
}

The first assert fails. Any ideas as to what could be the cause?
Regards,

Rob.
============================

Robert Mansfield

Senior Software Engineer

Redwood Technologies Limited

Tel +[44] (0)1344 304 344

Fax +[44] (0)1344 304 345

E:mail mailto:rjm@xxxxxxxxxxxxxxx <mailto:rjm@xxxxxxxxxxxxxxx> Web http://www.redwoodtech.com <http://www.redwoodtech.com/>
============================

Email Disclaimer

The information in this email is confidential and may be legally privileged. It 
is intended solely for the addressee. Access to this email by anyone else is 
unauthorised. If you are not the intended recipient, any disclosure, copying, 
distribution or any action taken or omitted to be taken in reliance on it is 
prohibited and may be unlawful. When addressed to our clients any opinions or 
advice contained in this email are subject to the limitations of Redwood 
Technologies Limited's standard terms and conditions of contract.



------------------------------------------------------------------------

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel