Re: [asterisk-users] Got bitten by the 255 char variable limit - how best to work around it?

2016-10-24 Thread Matt Fredrickson
On Sat, Oct 22, 2016 at 8:05 PM, Jonathan H  wrote:
> I loop through a list in Asterisk which is generated by a Python AGI
> and I've just been bitten by a variable limit I didn't realise existed
> before.
>
> The only way I can think of working around this is to get Python to
> write the list to file, then do a FILE_COUNT_LINE to get the number of
> items (needed first) and then iterate through them by doing FILE to
> read one line at a time.
>
> Would rather stay away from polluting ASTDB, and don't want to install
> MySQL as I don't need it for anything else.
>
> Ideally, though, is there a workaround for the variable limit? Thanks!

I was curious about this and started looking through the code to
remember how this all worked.  I don't see anything specifically that
would truncate setting a channel variable internally, but perhaps it's
a limitation due to how AGI is processed or buffers used for
parsing/interpreting there.  There are a number of fixed sized buffers
used in the AGI parsing code.  I'm curious, what version of Asterisk
are you using?

I'm not aware of any workarounds other than those you mentioned.  If
you wanted to get really into it, you could poke around in
res/res_agi.c and see if you can figure out which buffer is limiting.
YMMV there though.

-- 
Matthew Fredrickson
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Got bitten by the 255 char variable limit - how best to work around it?

2016-10-22 Thread Jonathan H
I loop through a list in Asterisk which is generated by a Python AGI
and I've just been bitten by a variable limit I didn't realise existed
before.

The only way I can think of working around this is to get Python to
write the list to file, then do a FILE_COUNT_LINE to get the number of
items (needed first) and then iterate through them by doing FILE to
read one line at a time.

Would rather stay away from polluting ASTDB, and don't want to install
MySQL as I don't need it for anything else.

Ideally, though, is there a workaround for the variable limit? Thanks!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users