i could not find a transformation or function to unescape an uri, such as this:
sip%3Atest%40test.fi
did i miss it or is there a need to write one?
-- juha
2011/3/26 Juha Heinanen jh@tutpro.com:
i could not find a transformation or function to unescape an uri, such as this:
sip%3Atest%40test.fi
did i miss it or is there a need to write one?
Hi Juha, I don't understand why should it be needed. Why do you get a URI like that? In fact, ":" and "@" don't require to be hex-escaped.
The only parts of a SIP URI which can be escaped are the following:
- userinfo ( %63lice == alice ) - param name - param value
Maybe you are using some SIP spec that fully escapes a SIP URI into some param value and so?
Cheers.
Iñaki Baz Castillo writes:
Hi Juha, I don't understand why should it be needed. Why do you get a URI like that? In fact, ":" and "@" don't require to be hex-escaped.
inaki,
sorry about the noise. i figured it myself too that : and @ in sip uri cannot be escaped. my problem is that for some reason i got such escaped uris in xcap rls document that i created using xcap-rls-services cli tool:
<?xml version='1.0' encoding='UTF-8'?> <rls-services xmlns="urn:ietf:params:xml:ns:rls-services"> <service uri="sip:jh_all@test.fi"> <resource-list>http%3A//xcap.test.fi%3A8080/xcap-root/resource-lists/users/sip%3Ajh%40test.fi/generallist.xml/%7E%7E/resource-lists/list%5B%40name%3D%22oma_buddylist%22%5D</resource-list> <packages> <package>presence</package> </packages> </service> <service xmlns:rl="urn:ietf:params:xml:ns:resource-lists" uri="sip:jh-buddies@test.fi"> <list> <rl:entry uri="sip%3Atest%40test.fi"/> <rl:entry uri="sip%3Afoo%40test.fi"/> </list> <packages> <package>presence</package> </packages> </service> </rls-services>
and then subscriptions to the list, of course, failed, because of the escapes.
perhaps there is a bug in the tool.
-- juha
Hello,
there is a transformation to get %hexa back to ascii char, have you tried this one? http://www.kamailio.org/dokuwiki/doku.php/transformations:3.1.x#sunescapeuse...
Cheers, Daniel
On 3/26/11 6:42 AM, Juha Heinanen wrote:
Iñaki Baz Castillo writes:
Hi Juha, I don't understand why should it be needed. Why do you get a URI like that? In fact, ":" and "@" don't require to be hex-escaped.
inaki,
sorry about the noise. i figured it myself too that : and @ in sip uri cannot be escaped. my problem is that for some reason i got such escaped uris in xcap rls document that i created using xcap-rls-services cli tool:
<?xml version='1.0' encoding='UTF-8'?>
<rls-services xmlns="urn:ietf:params:xml:ns:rls-services"> <service uri="sip:jh_all@test.fi"> <resource-list>http%3A//xcap.test.fi%3A8080/xcap-root/resource-lists/users/sip%3Ajh%40test.fi/generallist.xml/%7E%7E/resource-lists/list%5B%40name%3D%22oma_buddylist%22%5D</resource-list> <packages> <package>presence</package> </packages> </service> <service xmlns:rl="urn:ietf:params:xml:ns:resource-lists" uri="sip:jh-buddies@test.fi"> <list> <rl:entry uri="sip%3Atest%40test.fi"/> <rl:entry uri="sip%3Afoo%40test.fi"/> </list> <packages> <package>presence</package> </packages> </service> </rls-services>
and then subscriptions to the list, of course, failed, because of the escapes.
perhaps there is a bug in the tool.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
there is a transformation to get %hexa back to ascii char, have you tried this one? http://www.kamailio.org/dokuwiki/doku.php/transformations:3.1.x#sunescapeuse...
i didn't, because @ is not allowed in userpart. anyway, as i mentioned, the problem is elsewhere. xcap doc should not contains uris in escaped form or alternatively they should be unescaped automatically when they are fetched from xcap server by presence server.
-- juha
Hello,
On 3/26/11 7:45 AM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
there is a transformation to get %hexa back to ascii char, have you tried this one? http://www.kamailio.org/dokuwiki/doku.php/transformations:3.1.x#sunescapeuse...
i didn't, because @ is not allowed in userpart.
just for sake of clarification, the transformation can work on any kind of string, not only on valid 'username' values. It was named this way because at that time was targeting username parts of URI, otherwise just ignore the 'user' terminology in the name of transformation. Maybe would be good to rename (or add an alias) to s.unescape.hexa
Cheers, Daniel
anyway, as i mentioned, the problem is elsewhere. xcap doc should not contains uris in escaped form or alternatively they should be unescaped automatically when they are fetched from xcap server by presence server.
-- juha
2011/3/26 Juha Heinanen jh@tutpro.com: <resource-list>http%3A//xcap.test.fi%3A8080/xcap-root/resource-lists/users/sip%3Ajh%40test.fi/generallist.xml/%7E%7E/resource-lists/list%5B%40name%3D%22oma_buddylist%22%5D</resource-list>
Hi Juha, from my understanding the above syntax is indeed incorrect, as the URI should not be escaped in that way.