Subject: [Sip] Ambiguity in the SIP ABNF

From: "Pavitra Krishnaswamy" <[email-masked]>
Date: Tue, 16 Sep 2003 17:51:14 -0700

Hi,

There seems to be an ambiguity in the SIP ABNF

See grammar below:

----------------------------------------------------------------
accept-range = media-range *(SEMI accept-param)
media-range  = (   "*/*
                 / ( m-type SLASH "*" )
                 / ( m-type SLASH m-subtype )
               ) *( SEMI m-parameter )

m-parameter = m-attribute EQUAL m-value
m-attribute = token
m-value     = token / quoted-string

accept-param = ("q" EQUAL qvalue) / generic-param
qvalue       = ( "0" [ "." 0*3DIGIT ] )
               / ( "1" [ "." 0*3("0") ] )

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

----------------------------------------------------------------

An instance of ambiguity is when the accept-range construct has the
following structure -

*/*;abc=10;abc=10

In the above text string, "*/*" is the first part of media-range.

But what about the text which follows - ";abc=10" ? It conforms to the
grammar of m-parameter (by the rule "m-attribute EQUAL m-value" which can be
of the type "token EQUAL token"). BUT it also conforms to the grammar of
accept-param (by the rule "generic-param" which can be of the type "token
EQUAL token").

Since *(SEMI m-parameter) as well as *(SEMI accept-param) can be optional,
which grammar rules do the ";abc=10" texts belong to - the *(SEMI
m-parameter) OR the *(SEMI accept-param)???

One way to get around the ambiguity would be to change the rule for
media-range as follows -

media-range  = (   "*/*
                 / ( m-type SLASH "*" )
                 / ( m-type SLASH m-subtype )
               ) *( HYPHEN m-parameter )

Has anyone else faced this issue? Any help on this would be appreciated.

Thanks,
pavitra

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: prasanna 70008 <[email-masked]>
Date: Thu, 18 Sep 2003 11:01:16 +0800

Hi Pavitra,
Yes this is an ambiguity.  However this is clarified in RFC-2616's (HTTP) section on the accept-params.  The media range params and the accept params are seperated by the q parameter.
Cheers,
Prasanna 

----- Original Message -----
From: Pavitra Krishnaswamy <[email-masked]>
Date: Wednesday, September 17, 2003 8:51 am
Subject: [Sip] Ambiguity in the SIP ABNF

> accept-param (by the rule "generic-param" which can be of the type 
> "tokenEQUAL token").
> 
> Since *(SEMI m-parameter) as well as *(SEMI accept-param) can be 
> optional,which grammar rules do the ";abc=10" texts belong to - 
> the *(SEMI