2010/11/26 Juha Heinanen <jh(a)tutpro.com>om>:
inaki,
based on what in rfc3261 syntax?
Contact = ("Contact" / "m" ) HCOLON
( STAR / (contact-param *(COMMA contact-param)))
contact-param = (name-addr / addr-spec) *(SEMI contact-params)
name-addr = [ display-name ] LAQUOT addr-spec RAQUOT
addr-spec = SIP-URI / SIPS-URI / absoluteURI
display-name = *(token LWS)/ quoted-string
contact-params = c-p-q / c-p-expires
/ contact-extension
SIP-URI = "sip:" [ userinfo ] hostport
uri-parameters [ headers ]
my reading of the above is that the whole contact body can be an
addr-spec.
Juha, I can ensure you that I'm right, I studied it a lot some time
ago. In fact, Contact has similar syntax than From header (but Contact
allows various entries separated by comma). It's very common to see
the following From format:
From: sip:alice@domain.org;tag=qweqwe
For sure, Fromtag MUST be a header param and not a URI param (as
Fromtag is defined to be a header param in RFC3261).
RURI is a addr-spec, so any param in the RURI is, of course, a URI param.
But in case a From/Contact/To header contains a addr-spec then a param
is ALWAYS a header param. If you want to add a URI param in these
headers you MUST user name-addr format.
One more argument:
contact-param = (name-addr / addr-spec) *(SEMI contact-params)
Imagine you use addr-spec, you want a URI param ";uri-param=1234" and
a header param ";header-param=9999". How would it look?:
Contact: sip:alice@dom.org;uri-param=1234;header-param=9999
If you were right, how to determine that ;uri-param is a URI param and
;header-param is a header param? There is no way!
So the only solution is using name-addr:
Contact: <sip:alice@dom.org;uri-param=1234>;header-param=9999
This is a complex grammar in the RFC 3261, and there have been long
discussions about it in sip-implementors maillist, you can search for
them if you want.
my reading of the above is that the whole contact body
can be an
addr-spec.
Yes, of course, but then it CANNOT contain URI params, just header params.
Regards.
--
Iñaki Baz Castillo
<ibc(a)aliax.net>