Hi,
I’m trying to use :
Asterisk Dial Options
with RAND(x,y) function
to
limit inbound call duration randomly between 10 - 50 minutes.
So I will try this:
L(${RAND(600000,3000000)},${RAND(600000,3000000)})
Now I have 2 questions:
Will this work ? Did anyone try this?
Can I disable the warning message?
If I can use it then how deep can I nest other instructions? to achieve call disconnection to be always between 0-15s of the whole minute.
Also if you have any other ways/suggestions please let me know.
I would create the random number and load it into a variable then pass the variable to the dial command.
dicko
(dicko)
April 28, 2014, 2:30am
4
asterisk has within it’s math functions modulo (%) , there are 60 seconds in a minute
http://www.voip-info.org/wiki/view/Asterisk+func+math
dicko
(dicko)
April 28, 2014, 2:34am
5
(You explicitly set the warning with your second (y) argument, if you don’t want it leave it blank)
dicko
(dicko)
April 28, 2014, 3:01am
7
And to be strictly within your spec. perhaps:-
L(${RAND(10,50)*60 + RAND(,15)})
which would account for positive offsets on the minute between 0 and 15 seconds, to include negative offsets just expand the expression, it’s not rocket science just high school math.