Steve Murphy
2006-Oct-13 21:30 UTC
[asterisk-users] Re: Generate Random Numbers in dialplan
On Fri, 2006-10-13 at 12:52:38 -0400, Jon Weisman <jweisman@ibell.net> wrote:> Hi All, Anyone know how to generate random numbers in the > dial plan? I've tried using the RAND function but it doesnt > work. Basically I need to generate a random 5 digit number > everytime a particular extension is dialed and then save that > into a variable. Any ideas? Thanks, JonJon-- RAND really does work, but in trunk it's documented to use a comma to sep min and max, which is wrong. You have to use the vertical bar (|). Try it, it does work: AEL snippet: Set(junky=${RAND(0|99999)}); Verbose(Here is a random number: ${junky}.); murf -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3239 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20061013/fa5247cf/smime.bin
Jon Weisman
2006-Oct-14 09:45 UTC
[asterisk-users] Re: Generate Random Numbers in dialplan
Steve, Is RAND available in the latest trunk or do I need the 1.4 beta? If I do show function RAND it says its not available. Thanks, Jon ----- Original Message ----- From: "Steve Murphy" <murf@parsetree.com> To: <asterisk-users@lists.digium.com> Sent: Saturday, October 14, 2006 12:30 AM Subject: [asterisk-users] Re: Generate Random Numbers in dialplan> _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Alexander Lopez
2006-Oct-14 10:04 UTC
[asterisk-users] Re: Generate Random Numbers in dialplan
Use the AGI I sent. It looks like the email did not put a <CR> correctly. Run it from the commandline and see if you get output.> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Jon Weisman > Sent: Saturday, October 14, 2006 12:45 PM > To: murf@parsetree.com; Asterisk Users Mailing List - Non-Commercial > Discussion > Subject: Re: [asterisk-users] Re: Generate Random Numbers in dialplan > > Steve, > > Is RAND available in the latest trunk or do I need the 1.4 beta? > > If I do show function RAND it says its not available. > > Thanks, > Jon > > ----- Original Message ----- > From: "Steve Murphy" <murf@parsetree.com> > To: <asterisk-users@lists.digium.com> > Sent: Saturday, October 14, 2006 12:30 AM > Subject: [asterisk-users] Re: Generate Random Numbers in dialplan > > > > _______________________________________________ > > --Bandwidth and Colocation provided by Easynews.com -- > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Maybe Matching Threads
- Sending Set Asynchronous Balanced Mode Extended
- Re: Generate Random Numbers in dialplan
- Canadian Termination $0.0039 / Minute
- [Bug 1328] New: Please allow ipset add and del via the /proc/net/xt_ipset mechanism
- Is existing CDR in Asterisk is enough for complete billing