[Home]

Summary:ASTERISK-24730: [patch] Add blank line between headers and output for Command action response
Reporter:Gareth Palmer (gareth)Labels:
Date Opened:2015-01-27 22:18:26.000-0600Date Closed:2016-09-23 14:10:06
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface/NewFeature
Versions:SVN 11.15.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) ami-command-blank-line-431113.patch
Description:This patch adds a blank line between the headers and the output in the Command action response. The reason for this change is to make it easier to determine where the headers end and the output from the command starts.

Currently, to parse a response to a Command action, one has to:

1. Read one line, if line is {{Response: Error}}, parse the remaining as a standard AMI response and stop.
2. Read one more line - or two if you used an {{ActionID}} - those lines are the headers.
3. Then read everything up to {{--END COMMAND\r\n\r\n}}.

That could be changed to:

1. Read standard AMI response.
2. If {{Response: Follows}}, then read everything up to {{--END COMMAND\r\n\r\n}}.

The AMI version has been increased to 2.8.0 as this is a protocol change and so that clients detect the new behaviour.

Adding a blank line should not cause older parsers to fail as they have to read everything up to {{--END COMMAND\r\n\r\n}} anyway.

Adding a blank line will also not cause the AMI to HTML/XML encoder to fail to separate the headers from the output as it checks for the presence of a {{:}} character, which a blank line does not contain.
Comments:By: Rusty Newton (rnewton) 2015-02-03 17:12:13.059-0600

Thanks for the submission Gareth. Please continue with the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process] and post a review on Reviewboard. You can then update this issue with the reviewboard review URL.