[asterisk-bugs] [Asterisk 0013061]: random appears to be broken

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Jul 12 05:18:12 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13061 
====================================================================== 
Reported By:                danpwi
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13061
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.20.1 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-12-2008 02:11 CDT
Last Modified:              07-12-2008 05:18 CDT
====================================================================== 
Summary:                    random appears to be broken
Description: 
As far as I can tell, random() always returns false.  To reproduce:

context ael-randtest {
   123 => {
      one=0; two=0;
      for(x=0; ${x} < 100; x=${x} + 1) {
         random(50)
            one=${one} + 1;
         else
            two=${two} + 1;
      }
      Verbose(0,${one} ${two});
   }
}

and then 'originate Local/123 at ael-randtest application noop' from the CLI.
 It always outputs '0 100' as opposed to the expected (approx) 50 50.
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 07-12-08 05:18  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 130373

U   branches/1.4/pbx/pbx_ael.c

------------------------------------------------------------------------
r130373 | mvanbaak | 2008-07-12 05:18:09 -0500 (Sat, 12 Jul 2008) | 6
lines

in 1.4 the functions still have | as argument seperator.
This commit fixes the use of RAND in the ael random function.

(closes issue http://bugs.digium.com/view.php?id=13061)
Reported by: danpwi

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=130373 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-12-08 05:18  svnbot         Note Added: 0090137                          
======================================================================




More information about the asterisk-bugs mailing list