How to Create Random Numbers

Get help with installing and running AsteriskNOW.

Moderators: Moderator, Support

How to Create Random Numbers

Postby firmanpman » Sun Dec 07, 2014 9:33 pm

Dear all,

I need your help. I have 20 numbers, example :
1234561
1234562
1234563
......
12345620

how to create a random numbers in AsteriskNow, I meant when my staff wanna calling some client in the same time, the numbers will appear in random method.
This is the illustration :
agent 1 calling to client = the numbers 12345617
agent 2 calling to client = the numbers 1234563
agent 3 calling to client = the numbers 1234569
etc.

Please help.

Thanks
firmanpman
Newsterisk
 
Posts: 1
Joined: Sun Dec 07, 2014 9:25 pm

Re: How to Create Random Numbers

Postby johnkiniston » Mon Dec 08, 2014 9:12 am

Check out the RAND function

https://wiki.asterisk.org/wiki/display/ ... ction_RAND

exten => _X.,1,Noop()
same => Set(CALLERID(num)=555555555${RAND(1,9)})
same => n,Dial(SIP/${EXTEN}@gateway)

My example would pick a random number from 1-9 and use it as the last digit of your callerid.
johnkiniston
Oldsterisk
 
Posts: 53
Joined: Thu Nov 15, 2012 6:50 pm
Location: Tucson, AZ


Return to AsteriskNOW Support

Who is online

Users browsing this forum: No registered users and 1 guest