[asterisk-dev] How to change length of variable

Terry Wilson twilson at digium.com
Wed Oct 19 02:03:54 CDT 2011


> I understand that Asterisk have limit of the length of the variable -
> 256 characters.
> How I can change this limit?
> I want to recieve long variables from AGI-script.
> What I need to fix in the sources?

I'm pretty sure that the maximum value length for dialplan variable substitution is 4095 characters + the terminating NULL. Look at VAR_BUF_SIZE in main/pbx.c. It looks like res/res_agi.c on the getvariable function it limits the string length to 1024 with the tempstr variable. You might also check out AGI_BUF_LEN in res/res_agi.c as it looks like it might limit things as well (it is set to 2048).

Looks like it would be nice for us to set some global limits and be consistent with them all over the place (or just stop using stack-allocated buffers for things and remove the arbitrary limits on variable values).

If you are talking about the length of dialplan variable names, I am not aware of a limit on those. I could always be wrong, though.

Terry



More information about the asterisk-dev mailing list