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.
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