Outbound CID based on dialing prefix w/o editing extensions_custom?

Hello all,

I’m migrating from FreePBX 2.1.1 on VMWARE to a FreePBX on a dedicated machine, so I thought I’d revisit this:

Currently, I set my outbound caller ID based on what prefix I dial. Here’s a bit of what I have in extensions_custom:

exten => _25NXXNXXXXXX,1,Set(CALLERID(all)=“Caller ID One” <5555551212>)
exten => _25NXXNXXXXXX,n,Macro(dialout-trunk,5,1${EXTEN:2},)
exten => _25NXXNXXXXXX,n,Macro(dialout-trunk,7,1${EXTEN:2},)
exten => _25NXXNXXXXXX,n,Macro(dialout-trunk,1,${EXTEN:2},)
exten => _25NXXNXXXXXX,n,Macro(outisbusy,)

exten => _26NXXNXXXXXX,1,Set(CALLERID(all)=“Caller ID Two” <6666662323>)
exten => _26NXXNXXXXXX,n,Macro(dialout-trunk,5,1${EXTEN:2},)
exten => _26NXXNXXXXXX,n,Macro(dialout-trunk,7,1${EXTEN:2},)
exten => _26NXXNXXXXXX,n,Macro(dialout-trunk,1,${EXTEN:2},)
exten => _26NXXNXXXXXX,n,Macro(outisbusy,)

…I’m wondering if there’s a way to do this in the FreePBX shell, without resorting to adding lines to extensions_custom. If only the “outbound routes” page had an entry for setting caller ID!

Thanks for any help you can provide,


I have a similiar setup. My FreePBX sits between a legacy switch and the telco. My PRIs are configured as pri_net and pri_cpe.

I found out the hard way that when my legacy switch dials a number without providing outbound ANI that I have to use “SetCallerPres(allowed)” in order to change the CallerID.

I intercept the outbound call in [outbound-allroutes-custom]. I fix the CallerID based on the first two digits. Then I remove those digits and ship the call back into the Dialplan again. This allows me to use my existing outbound routes without customizing them.

I also agree that Outbound Routes should have a CallerID - like trunks do. There should also be an option for both Trunks and Routes to override the CallerID only if none is provided. Currently, the Trunk “Outbound Caller ID” always overrides the extension.

Here’s my extensions_custom.conf:

exten => _02.,1,SetCallerPres(allowed)
exten => _02.,n,Set(CALLERID(all)=“CallerID Two” <2222222222>)
exten => _02.,n,Goto(from-internal,${EXTEN:2},1)
exten => _02.,n,Hangup()

exten => _03.,1,SetCallerPres(allowed)
exten => _03.,n,Set(CALLERID(all)=“CallerID Three” <3333333333>)
exten => _03.,n,Goto(from-internal,${EXTEN:2},1)
exten => _03.,n,Hangup()

exten => _04.,1,SetCallerPres(allowed)
exten => _04.,n,Set(CALLERID(all)=“CallerID Four” <4444444444>)
exten => _04.,n,Goto(from-internal,${EXTEN:2},1)
exten => _04.,n,Hangup()

Hi Mike,

 Please see comment #22 <a href=http://pbxinaflash.com/forum/showthread.php?t=4725&page=3>here</a>.  From reading about SetCallerPres, it sounds like there is indeed a "show the callerID" bit.  Fascinating!

 By the way, read the rest of the topic if you want to see a slick way of using a Route's password field to set callerID.