Summary:ASTERISK-20294: Asterisk is unable to execute AGI commands longer than 2048 bytes
Reporter:Pavlo Lavrenenko (santa)Labels:
Date Opened:2012-08-22 03:50:22Date Closed:2012-08-22 09:18:25
Versions:10.7.0 Frequency of
Environment:Attachments:( 0) agi.log
( 1) testagi.pl
Description:Asterisk is unable to execute AGI commands longer than 2048 bytes, which are limited by statically allocated char buf[AGI_BUF_LEN]; buffer in res/res_agi.c::3466

What was done:
1. Asterisk 10.7.0 from http://svn.asterisk.org/svn/asterisk/tags/10.7.0 configured and installed with --refix=/opt/asterisk-10.7.0;
2. Sample configs have been installed with make samples;
3. Peer added to sip.conf, Linksys UA registered;
4. exten => 000112, 1, AGI(/home/santa/sandbox/testagi.pl) added to [default] context in extensions.conf;
5. testagi.pl executes Background AGI application with concatenated promts as a parameter and total length > 4k;
6. A test call has been made to 000112.

Expected results:
Asterisk plays all the prompts sequentially.

Real results:
Asterisk reads up to 2048 bytes on each fgets() iteration, the command is being cutted up and not all prompts are being played.

See agi log and testagi.pl code in attachment.
Comments:By: Matt Jordan (mjordan) 2012-08-22 09:18:07.654-0500

This is a limitation of AGI and is not a bug.  Changing this to accept commands greater than 2048 bytes, e.g., of unlimited length, would be an improvement.  You will also run into limitations in the dialplan for the length of allowed arguments to applications - so this is probably going to run into general improvements in other areas of Asterisk as well.

By: Matt Jordan (mjordan) 2012-08-22 09:18:18.268-0500

Features requests are no longer submitted to or accepted through the issue tracker. Features requests are openly discussed on the mailing lists [1] and Asterisk IRC channels and made note of by Bug Marshals.

[1] http://www.asterisk.org/support/mailing-lists