Subject: RE: Question regarding formulating transaction replies.

From: "Rosen, Brian" <[email-masked]>
Date: Fri, 27 Apr 2001 11:11:47 -0400

> Now lets say we had an error processing the Add command on 
> line 6, from my
> understanding of the discussions so far we'd have:
> 
> MEGACO/1 [124.124.124.222]:55555
> Reply = 50003 {
>    Context = 5000 {
>      Add = A5555,
>      Error = 442 {"Syntax error in command"}
>    }
> }
I think the last two lines should be
	 Add = A5555 { 
             Error = 422 { ...
 
> Although on careful examination of the ABNF this is incorrect.
Is it okay with the above correction?

> 
> Now lets say we had a syntax error in the first action, specifically a
> missing "}" on line 8, I would think we'd have as a reply:
> 
> MEGACO/1 [124.124.124.222]:55555
> Reply = 50003 {
>    Context = 5000 {
>      Add = A5555,
>      Add = A5556 { ...
>      }
>    }
>    Error = 422 {"Syntax error in action"}
> }
I dunno.  I'd report it as
     Context= 5001 { Error = 422
if my parser really was that smart.  I might expect most parsers to
determine
that it's a syntax error in a command, as without the RBRKT, it is expecting

another command.

If so, your syntax would be right, but the error would be 442.

> And finally if we had a syntax error in transaction, 
> specifically a missing
> "}" on line 13, I would think we'd have as a reply:
> 
> MEGACO/1 [124.124.124.222]:55555
> Reply = 50003 {
>    Context = 5000 {
>      Add = A5555,
>      Add = A5556 { ...
>      }
>    }
> 
>    Context = 5001 {
>      Subtract = A5555 { ...
>      },
>      Subtract = A5556 { ...
>      }
>    }
>    Error = 403 {"Syntax error in transaction"}
> }
Same issue.  

Brian

---

From: "Paul Long" <[email-masked]>
Date: Fri, 27 Apr 2001 20:32:46 -0500

Brian,

1. In your response to Steven's first question, wouldn't that be incorrectly
reporting an error while processing the first Add rather than the second?
IOW, does the presence of an error descriptor, regardless of error code, in
a reply to a command mean that that particular command failed? If so,
wouldn't this be preferable:

    Add = A5555,
    Add = $ {
        Error = 442 { ...

Or are you saying that since error code 422 refers to the action and not the
command, it could be returned in any command in that action since it applies
not to the command to which it is attached but to the larger construct (the
action)? Hmmm... That would mean in general that we would have to evaluate
each error code to determine exactly what it refers to and not be able to
rely solely on its position in the syntax. Ugh... :-(

2. Regarding your response to the second question, aren't you assuming that
the parser can resynch at the next action, which it may or may not be able
to do? If it can't, it wouldn't know what the next contextID was in order to
reply the way you suggested. It may not even know that there _is_ another
action. Here is the relevant text.

8.2.2: "If the end of an action cannot be reliably determined but one or
more Actions can be parsed, it will process them and then send 422 Syntax
Error in Action as the last action for the transaction."

Hmm. If the end of an action cannot be determined, how can it be (fully)
parsed? I guess this means, "can be parsed enough." :-) (Or maybe this is a
typo, and it should say, "but one or more _commands_ can be parsed." I bet
that's it.) Okay, then this is what we're supposed to do:

     Add = A5556 {

Uh, oh. There's that error descriptor again that doesn't really apply to the
thing to which it is attached. I guess there is no way around it, though,
huh?

3. Regarding Steve's last question, here's the relevant text:

8.2.2: "If the end of a transaction can not be reliably determined and one
or more Actions can be parsed, it will process them and then return 403
Syntax Error in Transaction as the last action reply for the transaction."

This doesn't make sense, though, because how does one return an error
descriptor "as the last action reply?" Here's the ABNF for actionReply.

actionReply = CtxToken EQUAL ContextID LBRKT ( errorDescriptor /
commandReply ) RBRKT

Are we supposed to create a new actionReply to hold the error descriptor,
like this?

   Context = - {

Pretty ugly, specifying the null context, but this is the only way I can
figure out to satisfy the above normative text.

Paul Long
ipDialog, Inc.

-----Original Message-----
From: [email-masked]
[mailto:[email-masked]]On Behalf Of Rosen, Brian
Sent: Friday, April 27, 2001 10:12 AM
To: 'Steven Weisz'; Megaco Mailing List (E-mail)
Subject: RE: Question regarding formulating transaction replies.

another command.

Same issue.

Brian