[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 15:37:25 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 15:37 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 ?
====================================================================== 

---------------------------------------------------------------------- 
 murf - 10-05-07 15:37  
---------------------------------------------------------------------- 
Well, ......

OK. I've thought it over and mayhaps we can compromise.
What if I reduced a macro arg count mismatch to a warning?

My main concern is that you are/have been hurting yourself by doing this
sort of thing...

First of all, both macro and gosub, when called with fewer args than they
use, will blithely use those unsupplied args... which could be blank, or...
whatever might last have been passed under ARGn in some recursive call!
(because the names ARG1, ARG2, etc are kept in global space in 1.2, and
1.4, and trunk for that matter.

So, the challenge: to insure enough commas/vertbars are in the call to
pass empty values.

So, tell me: how did you insure that you weren't getting garbage in the
calls with fewer args than used in the macro? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-05-07 15:37  murf           Note Added: 0071562                          
======================================================================




More information about the asterisk-bugs mailing list