RANDOM NUMBERS in Asterisk 1.2

hello mates

i need to generate a random number between 1 and 20, the servers that i`m workin on has asterisk 1.2 so i cannot use the RAND() :S

i also read about the Random() function which works on probabilities??? WTH?? :open_mouth:

is there any other easy way to generate a number between 1 and 20?? something like the RAND() that works in asterisk 1.2

thanks dudes

if nothing works for you from with in asterisk, you can use AGI as a last resort. Whenever you want a random number execute AGI script in dialplan use your favorite language to generate random number, set the random number as a channel variable and exit the script. You can read that random number channel var later in your dial plan whenever you want.


Asterisk Consultant Hyderabad

im still a beginner in asterisk .. im good at PHP but im not that good when it comes to PHPAGI, but its a good idea though i will try to make it happen, tnx.

if you have any idea how to set a channel variable through the AGI script in php post ur code here and i`ll try 2 use it