Subject: RE: SDP and ';' comments

From: "David Stonehouse" <[email-masked]>
Date: Fri, 18 May 2001 12:47:15 -0400

The resolution to Troy's initial statement is not only because of the way an
SDP ends, but also in the way that the octetString terminal will force the
Megaco parser to pull everything up to the '}' into the octetString.  The
net result is even though the official definition of RBRKT allows for a
comment in front or behind, in this case, there will never be any LWSP
(including comments) for the Megaco parser to parse before the '}'.  The
resulting octetString is what will get passed to the SDP parser.  If this
string fails to parse according to SDP syntax, then the message should be
rejected for bad syntax (including any trailing Megaco comment ';').

So, even if the comment were added after the newline but before the '}', it
is still bad syntax because it falls under SDP parsing rules.  (A parser may
want to be liberal in accepting this, but that's beside the point.)

Pasting from Naren's post from last September (for which I never saw any
responses):

    4. escaping "}" in SDP strings
            I don't know if  "}" can appear in SDP attribute or VcId or
other
    values. Nonetheless to be safe, especially on the MGC side when you
might
    just want to treat SDP description as opaque, why not delimit the the
    description with a line that starts with "==" (two "=" symbols) or a
similar
    illegal combination? Using "\}" is really not feasible.

The issue isn't that "}" could appear in SDP - it's whether "\}" could
appear in SDP.  If it can not, then it is okay for the Megaco parser to
translate the "\}" to "}", and pass the resulting string to the SDP parser.

Dave

-----Original Message-----
From: Troy Cauble [mailto:[email-masked]]
Sent: Friday, May 18, 2001 9:28 AM
To: MEGACO list
Subject: Re: SDP and ';' comments

Good point!  SDP does require the newline!
-troy

"Tulpule, Naren" wrote:
> 
> Megaco wankers :)
> [NAREN] Hey now, it's not Friday evening yet, Troy :-)
> Check out
>
http://standards.nortelnetworks.com/scripts/wa.exe?A2=ind0009&L=MEGACO&P=R25
> 962 point (3).
> This has come up before.
> (If the link doesn't work try "search archives" with "SDP comment")
> So what if it's the last line of SDP - it still violates SDP syntax before
> the all important newline. It's just a Bad Example.
> We don't need the rule that you propose, because SDP last line (a= or
> whichever) is ALWAYS supposed to end with newline.
> 
> <end of comments, Troy's original message below>
> 
> At least one of the messages in Appendix A
> has SDP with an H.248 style comment:
> 
>                         Local {
> v=0
> c=IN IP4 $
> m=audio $ RTP/AVP 0
> a=fmtp:PCMU VAD=X-NNVAD ; special voice activity
>                            ; detection algorithm
>                         }
> 
> I assume we're not imposing these comments on SDP in general.
> But in this example it's the last line of SDP and the comments
> could be part of RBRKT.

---

From: Troy Cauble <[email-masked]>
Date: Fri, 18 May 2001 14:05:38 -0400

> David Stonehouse wrote:
> Megaco parser to pull everything up to the '}' into the octetString.  The net
> result is even though the official definition of RBRKT allows for a comment
> in front or behind, in this case, there will never be any LWSP (including
> comments) for the Megaco parser to parse before the '}'.  The resulting
> octetString is what will get passed to the SDP parser.  If this string fails
> to parse according to SDP syntax, then the message should be rejected for bad
> syntax (including any trailing Megaco comment ';').
> 

David,

While many parsers work this way, I don't think that using ABNF
implies that ambiguous text has to be applied to the preceding token.
That is, it's just as valid to associate the spaces in "}    }" with
the last RBRKT as the first.

So I think comments between the last line of SDP and the '}' are 
legal unless we explicitly document that they're not.

-troy

---

From: "Paul Long" <[email-masked]>
Date: Fri, 18 May 2001 14:28:11 -0500

Troy,

I have to agree with David. Although RFC2234 (ABNF) does not actually state
whether scanning is left to right or right to left, I can't imagine any
parser scanning backwards like that. I think it is implied that each
component in a rule definition fully matches--from left to right--without
regard to what components may follow. Therefore, I think the trailing
comments are matched by the octetString and not by the RBRKT.

Paul Long
ipDialog, Inc.

-----Original Message-----
From: [email-masked]
[mailto:[email-masked]]On Behalf Of Troy Cauble
Sent: Friday, May 18, 2001 1:06 PM
To: David Stonehouse
Cc: MEGACO list; 'Tulpule, Naren'
Subject: Re: SDP and ';' comments

> Megaco parser to pull everything up to the '}' into the octetString.  The
net

David,

-troy