[asterisk-bugs] [Asterisk 0016032]: [patch] AGI returns bogus "510 Invalid or unknown command"

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Oct 18 05:55:15 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16032 
====================================================================== 
Reported By:                notahat
Assigned To:                pabelanger
====================================================================== 
Project:                    Asterisk
Issue ID:                   16032
Category:                   Resources/res_agi
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     ready for review
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 222530 
Request Review:              
====================================================================== 
Date Submitted:             2009-10-06 21:19 CDT
Last Modified:              2010-10-18 05:55 CDT
====================================================================== 
Summary:                    [patch] AGI returns bogus "510 Invalid or unknown
command"
Description: 
When res_agi.c reads from the AGI stream, it incorrectly calculates the
number of free bytes remaining in the read buffer. In certain circumstances
(such as repeated EAGAIN errors from fgets), this causes it to incorrectly
interpret the buffer as full. That then confuses the code interpreting the
command, leading to a bogus "510 invalid or unknown command" error being
returned.
====================================================================== 

---------------------------------------------------------------------- 
 (0128154) fnordian (reporter) - 2010-10-18 05:55
 https://issues.asterisk.org/view.php?id=16032#c128154 
---------------------------------------------------------------------- 
i can confirm this bug. it also triggers when the agi sends more data in
one line then fgets is able to return at once.

the while-condition should also be fixed. unless i miss something, it
should only care about how much space is left in the target-buffer. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-10-18 05:55 fnordian       Note Added: 0128154                          
======================================================================




More information about the asterisk-bugs mailing list