Skip to main content

Increasing the number of macro arguments

Posted by cbbs70a on Tue, 11/27/2012

I need to create a macro that will be used for outbound routes to define 5 trunks. Looking at tl-dialout-2-trunks, there is one option defined for "how long to ring" plus four identical options for each trunk. Doing the math, defining 5 trunks will require 21 total options to specify. However, when I try to create the macro and add the options, I receive a message that says "Can not add argument, maximium of 20 arguments is allowed". That's probably an arbitrary number as far as I can tell. I looked at the Asterisk source and as far as I can tell, Asterisk can handle a maximum of 80 arguments passed to a macro. So what I am asking for is the ability to add more than 20 arguments when creating a macro.
Thanks;
FSD


Submitted by eeman on Wed, 12/05/2012 Permalink

ahh, that does sound like a limitation of the perl cgi more than anything. in the short term, have you considered modifying the base script so that you dont have to pass as many arg's to the base script for each trunk? Perhaps recylcing something like how long to ring, etc?

Submitted by cbbs70a on Wed, 12/05/2012 Permalink

Thanks for the input. Yes, I thought about decreasing the the number of arguments like you said, and that would certainly solve the problem in the short term with little sacrifice to the usability of the script. But what I ended up doing was creating the macro for 5 trunks (using 21 arguments), and then manually adding the macro to user_scripts.include and user_scripts_source.include. That way, I could still see all 21 arguments displayed in the outbound routes section. The only downside is that I cant see the last argument when editing the macro in the script library, which is no big deal to me since I can edit things quicker and easier in the config files using 'vi'.
Regards;
FSD