Need random outbound caller ID

For a number of years, I’ve been helping a buddy with his FreePBX/Asterisk 1.8 based call center telephone system. It’s been remarkably stable, and very capable. Now they want to add a feature where the outbound caller ID is randomly set from a small pool of their DIDs.

Google leads me to the RAND function, and an example that sounds like a perfect fit. My background is not in programming, however, and I don’t know how to implement this. Any help toward the goal would be very appreciated!

Here’s the example I found…

[code]if we had few caller ID number want to use it, try this:

[outbound]
exten => _886X.,1,Noop
same => n,Gosub(pickCallerIDnum,cell${RAND(1,5)},1)
same => n,Dial(SIP/${EXTEN}@gateway,32,gCX)

[pickCallerIDnum]
exten => cell1,1,Set(CALLERID(num)=09xxxxxxx1)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=09xxxxxxx2)
same => n,Return
exten => cell3,1,Set(CALLERID(num)=09xxxxxxx3)
same => n,Return
exten => cell4,1,Set(CALLERID(num)=09xxxxxxx4)
same => n,Return
exten => cell5,1,Set(CALLERID(num)=09xxxxxxx5)
same => n,Return[/code]

Thanks a lot,

Peter

I don’t do FreePBX but that looks like a valid solution.

I’d trim it down a lot however as that example just has way too many lines to do what you want.

[outbound]
exten => _X.,1,Noop()
same => Set(CALLERID(num)=555555555${RAND(1,5)})
same => n,Dial(SIP/${EXTEN}@gateway,32,gCX)

You should post on a FreePBX related forum or mailing list to find out how to add this to your outbound dialing.