[asterisk-bugs] [Asterisk 0010787]: Impossible to make optional macro arguments in 1.4

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Oct 5 21:59:50 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10787 
====================================================================== 
Reported By:                Luke-Jr
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   10787
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-21-2007 04:49 CDT
Last Modified:              10-05-2007 21:59 CDT
====================================================================== 
Summary:                    Impossible to make optional macro arguments in 1.4
Description: 
In 1.2, AEL didn't validate macro argument counts, and all was well. Now
AEL errors if they don't have the same number, which means macros are
forced to have a fixed number of arguments ?
====================================================================== 

---------------------------------------------------------------------- 
 Luke-Jr - 10-05-07 21:59  
---------------------------------------------------------------------- 
Hmm, interesting point! Perhaps coincidence I wasn't getting crazy output.
On the other hand, if I had known this earlier, I could have saved myself a
lot of coding, as many of my macros call other macros with the same exact
arguments they received.
That is (simplified):

  macro foo(a, b, c, d) {
    &foo2(${a},${b},${c},${d});
  };

If you're going to make it balance macro arguments with extra commas,
could you add some way to prevent that? Perhaps so I could replace such
occurances with:

  macro foo(a, b, c, d) {
    &foo2(${a},@);
  };

(in case the 'a' variable had changed within 'foo')

I wouldn't mind having to put the variable name in brackets to signify
that they are optional. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-05-07 21:59  Luke-Jr        Note Added: 0071574                          
======================================================================




More information about the asterisk-bugs mailing list