Subject: Question regarding formulating transaction replies.

From: Steven Weisz <[email-masked]>
Date: Fri, 27 Apr 2001 10:43:08 -0400

Hi List,

I have a question regarding how a transaction reply is formulated for
transactions with multiple actions and commands in them. Specifically, what
do we do when various syntax errors occur at the end of
command/action/transaction (usually a missing "}"). This email is a little
long but I think it is worth discussing since the ABNF for the protocol
seems to me to be a little ambiguous on the subject. 

Below I've tried to capture a few scenarios that I am unsure about, and my
general question is :
Is my reasoning correct or am I totally foul ball on it.

Note: I'm leaving out the details in the Commands and in the Replies.

In the perfect world if we received something which contained no errors
like:

1     MEGACO/1 [123.123.123.4]:55555
2     Transaction = 50003 {
3        Context = $ {
4           Add = A5555  { ...
5           },
6           Add  = $ { ...
7           }
8        }
9        Context = 5001 {
10          Subtract = A5555 {Audit{Statistics}},
11          Subtract = A5556 {Audit{Statistics}}
12       }
13    }

We'd just need to send something along the lines of:

MEGACO/1 [124.124.124.222]:55555
Reply = 50003 {
   Context = 5000 {
     Add = A5555,
     Add = A5556 { ...
     }
   }

   Context = 5001 {
     Subtract = A5555 { ...
     },
     Subtract = A5556 { ...
     }
   }
}

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"}
   }
}

Although on careful examination of the ABNF this is incorrect.

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"}
}

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"}
}

Thanks,

Steven Weisz