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

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


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


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

Web 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.