[asterisk-bugs] [JIRA] (ASTERISK-20524) AMI improperly handles lines of exactly 1025 characters
Asterisk Team (JIRA)
noreply at issues.asterisk.org
Wed Jul 27 10:24:15 CDT 2016
[ https://issues.asterisk.org/jira/browse/ASTERISK-20524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Asterisk Team updated ASTERISK-20524:
-------------------------------------
Target Release Version/s: 14.0.0
> AMI improperly handles lines of exactly 1025 characters
> -------------------------------------------------------
>
> Key: ASTERISK-20524
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-20524
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/ManagerInterface
> Affects Versions: 1.8.16.0
> Reporter: David M. Lee
> Assignee: Corey Farrell
> Severity: Minor
> Target Release: 14.0.0
>
> Attachments: ami-line-length.sh
>
>
> I found this while working on my fix for AST-961, but didn't have a chance to really track it down.
> Attached I have a really simple script I use to stimulate long-line errors in the AMI parser. If you send lines of 1024 characters or less, everything works as expected. If you send lines of 1026 characters or more, it will respond with a 'line too long' error (assuming you have [my fix for long line errors|https://reviewboard.asterisk.org/r/2142/]).
> But if you send a 1025 character line exactly, AMI will read a bare newline immediately after the long line, terminating the message. This leads to an extra error response, which really confuses AMI libraries, such as [StarPy|https://github.com/asterisk-org/starpy].
> {code:none}
> # 1024 characters passes as expected
> $ ./ami-line-length.sh 1024
> == 1024 ==
> Asterisk Call Manager/1.1
> Response: Success
> Message: Authentication accepted
> Event: FullyBooted
> Privilege: system,all
> Status: Fully Booted
> Response: Success
> ActionID: 12345
> Variable: foo
> Value:
> # 1026 characters fails as expected
> [dlee at dlee-mac asterisk]$ ./ami-line-length.sh 1026
> == 1026 ==
> Asterisk Call Manager/1.1
> Response: Success
> Message: Authentication accepted
> Event: FullyBooted
> Privilege: system,all
> Status: Fully Booted
> Response: Error
> ActionID: 12345
> Message: Failed to parse message: line too long
> # 1025 characters has an extra error response
> # And, your command gets a 'Missing action' error instead of a 'line too long' error
> == 1025 ==
> Asterisk Call Manager/1.1
> Response: Success
> Message: Authentication accepted
> Event: FullyBooted
> Privilege: system,all
> Status: Fully Booted
> Response: Error
> Message: Failed to parse message: line too long
> Response: Error
> ActionID: 12345
> Message: Missing action in request
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list