QUESTION Need random outbound caller ID

Fortel

Guru
Joined
Oct 19, 2007
Messages
121
Reaction score
3
Location
Northern California
For a number of years, I've been helping a buddy with his PIAF-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
Thanks,

Peter
 

Fortel

Guru
Joined
Oct 19, 2007
Messages
121
Reaction score
3
Location
Northern California
Check out a2billing, I'm pretty sure they have this functionality.
Thanks... I'll explore that for more information. But I think this can be done with some pretty light edits.

Experimenting with the example code, I've created a custom context "random," and pointed a test extension to it. I can manipulate the outbound caller ID, but not with any "randomness." I'll keep at it for a while, but obviously lack the programming basics!

Thanks again,

Peter
 

Fortel

Guru
Joined
Oct 19, 2007
Messages
121
Reaction score
3
Location
Northern California
Okay,

Code:
[macro-dialout-trunk-predial-hook]
exten => s,1,noop(Entering context ${CONTEXT} defined in extensions_custom.conf)
exten => s,n,Set(foo=${RAND(1,3)})  ;choose a random number between 1 and 3
exten => s,n,noop(choosing random CID #${foo})
exten => s,n,goto(${foo},1)
 
exten => 1,1,set(CALLERID(number)=5551111111)
exten => 2,1,set(CALLERID(number)=5552222222)
exten => 3,1,set(CALLERID(number)=5553333333)
I just put this in on a test machine, and it works!! So we're all set!!

Thanks a lot, especially to lgaetz! Very much appreciated!

Peter
 
  • Like
Reactions: lgaetz

Fortel

Guru
Joined
Oct 19, 2007
Messages
121
Reaction score
3
Location
Northern California
I thought I'd revisit this old thread, as the original need for "random" caller ID has changed a bit.

The pbx has DIDs for nearly every area code in the US. We'd like to set the outbound caller ID based on the area code dialed.

So, agent dials 212 555-1212, and the outbound caller ID would be something like 212 123-4567.

I realize this can be done via the GUI using Outbound Routes, but that's a lot of outbound routes to set up to include every area code!!

I did take a "BASIC" programming class in the 80's, but that isn't much help now!

Any ideas?

Thanks!

Peter
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
601
Reaction score
215
You might find that idea is a losing situation going forward as your calls will look like they are unsolicited and will fall foul of much burgeoning legislation/rules.

if you are not blind calling, then you will need to use a number that actually gets to call you back.
 

Fortel

Guru
Joined
Oct 19, 2007
Messages
121
Reaction score
3
Location
Northern California
Right-

They have about 300 DIDs with most of the US area codes that map back to their main IVR. So, if a call is initiated by an agent, the idea is, an appropriate number from the pool will be used for the outbound caller ID. At one point in the past, we'd set up something similar, but using random numbers (from a pool of actual DIDs mapped to their IVR.) So, an agent would place a call to a 415 area number, one of their DIDs would randomly be used for the outbound caller ID. I say random, knowing that isn't the actual case. But the CID wasn't "fixed," in any case, and any outbound caller ID was a real DID, which would be reachable if a recipient were to call it.

This is a friend's business PBX that I've set up and managed over the years...

I may just start setting up outbound routes, but roughly 300 of them... ugh!

So, if there are ideas, I'm all eyes and ears...

Thanks!

Peter
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
601
Reaction score
215
I would seed an asterisk database with a mapping of every area-code you need to a did in that areacode you own and use a dial out hook macro to set the CallerID(number) appropriately.
 

Fortel

Guru
Joined
Oct 19, 2007
Messages
121
Reaction score
3
Location
Northern California
That sounds right. Thanks for the nudge in that direction...

I'll need to search for some similar setup that I can adapt. Or complete some programming courses!
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
601
Reaction score
215
HeHe, IMHO it's only others who see me as trouble ;-)
 
  • Like
Reactions: wardmundy

Members online

Latest Posts

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,212
Messages
136,019
Members
14,460
Latest member
RodneyBarbados