add_rcv_param wuses illegal chars in contact uri

2 messages Options
Embed this post
Permalink
Juha Heinanen

add_rcv_param wuses illegal chars in contact uri

Reply Threaded More More options
Print post
Permalink
while testing alias_contact() function, i tried to steel some code from
nathelper add_rcv_param() function, but noticed that it adds illegal
chars to contact uri when it encloses the param in quotes ("):

                param[RECEIVED_LEN] = '\"';
                memcpy(param + RECEIVED_LEN + 1, uri.s, uri.len);
                param[RECEIVED_LEN + 1 + uri.len] = '\"';

i found out when twinkle complained about parse error in contact uri.  i
then went and checked from rfc3261 and twinkle is correct:

uri-parameter = transport-param / user-param / method-param
                 / ttl-param / maddr-param / lr-param / other-param
other-param = pname [ "=" pvalue ]
pvalue= 1*paramchar
paramchar = param-unreserved / unreserved / escaped
param-unreserved = [" / "]" / "/" / ":" / "&" / "+" / "$"

" is not listed in unreserved either. i don't know if anyone is
using that function.  if not, better remove it or fix it.

-- juha

_______________________________________________
sr-dev mailing list
[hidden email]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Iñaki Baz Castillo

Re: add_rcv_param wuses illegal chars in contact uri

Reply Threaded More More options
Print post
Permalink
El Domingo, 8 de Noviembre de 2009, Juha Heinanen escribió:

> while testing alias_contact() function, i tried to steel some code from
> nathelper add_rcv_param() function, but noticed that it adds illegal
> chars to contact uri when it encloses the param in quotes ("):
>
> param[RECEIVED_LEN] = '\"';
> memcpy(param + RECEIVED_LEN + 1, uri.s, uri.len);
> param[RECEIVED_LEN + 1 + uri.len] = '\"';
>
> i found out when twinkle complained about parse error in contact uri.  i
> then went and checked from rfc3261 and twinkle is correct:
>
> uri-parameter = transport-param / user-param / method-param
>                  / ttl-param / maddr-param / lr-param / other-param
> other-param = pname [ "=" pvalue ]
> pvalue= 1*paramchar
> paramchar = param-unreserved / unreserved / escaped
> param-unreserved = [" / "]" / "/" / ":" / "&" / "+" / "$"
>
> " is not listed in unreserved either. i don't know if anyone is
> using that function.  if not, better remove it or fix it.


Hi Juha, you are right, header params allow " in their values, however URI
params don't.



--
Iñaki Baz Castillo <[hidden email]>

_______________________________________________
sr-dev mailing list
[hidden email]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev