Summary:ASTERISK-18395: Lua applications argument length limitations
Reporter:Tiziano Martelli (tiziano)Labels:
Date Opened:2011-08-31 10:54:03Date Closed:2011-10-21 11:23:06
Versions:1.8.4 Frequency of
is related toASTERISK-18396 [patch] - Variables Truncated When Using Realtime Dialplan
Environment:Linux openSuse, kernel, x86Attachments:( 0) ASTERISK-18395-1.8.diff
Description:I found that the argument that, in extension.lua, one put between parenthesis when call an asterisk dialplan application, is truncated to 248 characters.
In particular, I've found it while building a string for an app.system() call, but, to simplify the reproducibility, I've used the following code:
when asterisk executes this, you only got the first 248 characters in CLI output (the string itself is 250 characters long, you loose the final "90"). If you try the equivalent code in extensions.conf:
exten => s,n,Set(LongVar="1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890)
exten => s,n,NoOp(${LongVar})
you get the correct output in CLI
Obviously this is a sample, the real problem is that I have a longer string in an app.system application and, while it works fine with standard extensions.conf, it's been truncated if I use lua. I've tested it in both and Any suggestion?
Comments:By: Leif Madsen (lmadsen) 2011-09-14 09:41:31.168-0500

Can the reporter test the patches on ASTERISK-18396 to see if that helps this situation as well? Thanks!

By: Leif Madsen (lmadsen) 2011-09-14 09:42:24.673-0500

Actually I don't think that is going to fix anything here. It's likely the same type of problem, but the patch only affects pbx_realtime, and not pbx_lua.

By: Tiziano Martelli (tiziano) 2011-09-16 09:01:47.326-0500

Excuse me, Leif, are you asking me to test the patches on ASTERISK-18396 to see if this would solve the lua arguments limitation too? I could add to my first report that, even on the same machine, to avoid doing any change to the running configuration, I've stopped the running asterisk, renamed the /etc directory and made a minimum configuration to see if the problem appears with extensions.conf too (and, as I already said, it's OK): in doing this, I've omitted to tell you (because I don't think that it could have any relevance) that the running asterisk (the instance where I've found the problem) has realtime enabled.

By: Matthew Nicholson (mnicholson) 2011-10-21 11:23:06.218-0500


By: Tiziano Martelli (tiziano) 2011-10-24 09:01:44.723-0500

Hi Matthew. Because I've received the notification of the closing of this bug, I've decided to try the 18396 patches (before I've asked to Leif if he thinks that could solve the problem). I'm now on, same hardware and operating system, and the problem is still here, exactly as before applying the patch: whatever follows app.noop() is truncated to 254 characters. Do I miss something? Please help me to understand what I've to do to solve this.

By: Matthew Nicholson (mnicholson) 2011-10-24 09:06:41.640-0500

Yes, this fix is not in Check the "Subversion Commits" tab on the page to find the revision this is fixed in for your branch. For 1.8, this is fixed in r341809. If it would be helpful, I can upload a patch containing the fix for you to apply to 1.8.7.

By: Tiziano Martelli (tiziano) 2011-10-24 09:28:53.075-0500

Matthew, you very kind, but I'm still not able to find what I need. If I click the "Subversion Commits" on this page (the same page from which I'm writing this, right?) then I click on the #341809 link (and here arise the first question: why 341809 and not, for example, 341810?) I got a page which says "ChangeSet empty" (the same if I click on another revision link). It would be great if you could upload a patch, but I also would like to understand what I'm doing wrong. Thanks.

By: Matthew Nicholson (mnicholson) 2011-10-24 10:26:20.313-0500

I have uploaded a patch for 1.8.

By: Matthew Nicholson (mnicholson) 2011-10-24 10:27:18.552-0500

I am not sure what you are doing wrong, I have not tried to use the links on that tab. I only use it to know what revision numbers I need to pull out of the repo.

By: Tiziano Martelli (tiziano) 2011-10-24 12:24:56.256-0500

Anyway, with the patch you've uploaded it works! Thank you