[SR-Users] path uri problem

Andrew Pogrebennyk apogrebennyk at sipwise.com
Tue Apr 9 11:12:39 CEST 2013


Hi Juha,

On 04/07/2013 01:51 PM, Juha Heinanen wrote:
> i escaped them, but it didn't help.  path header now looks like:
> 
> Path: <sip:192.98.102.10;transport=tcp;lr;received='sip:192.98.102.10:58156%3Btransport%3Dtcp'>.
> 
> and i still get the same error:
> 
> Apr  7 14:49:47 wheezy1 /usr/sbin/sip-proxy[8709]: ERROR: registrar [save.c:887]: Failed to parse Path: URI

I don't see why you think that ; and = should be escaped.

rfc3327 chapter 4 says:

   The syntax for Path is defined as follows:

   Path = "Path" HCOLON path-value *( COMMA path-value )

   path-value = name-addr *( SEMI rr-param )

   Note that the Path header field values conform to the syntax of a
   Route element as defined in [1].  As suggested therein, such values
   MUST include the loose-routing indicator parameter ";lr" for full
   compliance with [1].

The rules for Route element are as follows:

Route        =  "Route" HCOLON route-param *(COMMA route-param)
route-param  =  name-addr *( SEMI rr-param )
name-addr      =  [ display-name ] LAQUOT addr-spec RAQUOT
addr-spec      =  SIP-URI / SIPS-URI / absoluteURI

rr-param      =  generic-param
generic-param  =  token [ EQUAL gen-value ]
gen-value      =  token / host / quoted-string

Why would someone want to escape semicolor (SEMI) which separated either
Route or URI parameters?

Also EQUAL used in pname=pvalue does not need escaping.

We've already had a closer look at add_path_received() here at sipwise
when we found double quotes in Route param value to be invalid and
changed them to single ones. We have not observed the error in save()
you have posted in kamailio 3.3.. Moreover, the ibc's Ragel-SIP-Parser
suggests that the Path header above is correct :)

So, from my PoV:
- the ;transport=tcp;lr;received=... part are route-param's which follow
the above rules.
- the 'sip:192.98.102.10:58156;transport=tcp' part contains URI
parameters. It is still fine according to definition of Path/Route
element above - and agrees with the definition of other-param too:

SIP-URI = "sip:" [ userinfo ] hostport
 uri-parameters [ headers ]
uri-parameters = *( ";" uri-parameter)
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 = "[" / "]" / "/" / ":" / "&" / "+" / "$"
unreserved = alphanum / mark
mark = "-" / "_" / "." / "!" / "~" / "*" / "'"
 / "(" / ")"
alphanum = ALPHA / DIGIT
escaped = "%" HEXDIG HEXDIG

Do you also have the save() problem in 3.3?

Andrew



More information about the sr-users mailing list