Hi Dave,
I had thought about that but I want to be able to have a different CID for each user.
I ended up writing a script to do the work. Not very complex but it took me a while to find all the functions in asterisk as I dont code in it much.
Below is my solution in extensions_custom.conf
[macro-dialout-trunk-predial-hook]
exten => s,1,noop(================ OUTROUTE-CUSTOM ====================)
exten => s,n,Set(KTrunk=${CUT(custom,/,2)})
exten => s,n,noop(=== KTRUNK = ${KTrunk} ===)
exten => s,n,NoOp(CUSTOM: calleridall is ${CALLERID(all)})
exten => s,n,NoOp(CUSTOM: calleridnumber is ${CALLERID(number)})
exten => s,n,Set(KCID=${CALLERID(number)})
exten => s,n,GotoIf($["${KTrunk}" = "Nehos"]?Nehos)
exten => s,n,GotoIf($["${KTrunk}" = "DidLogic"]?DidLogic)
exten => s,n,MacroExit
exten => s,n(Nehos),noop(== NEHOS ==)
exten => s,n,noop(== ${KCID} == 0${KCID:2} ===)
exten => s,n,Set(CALLERID(name)=0${KCID:2})
exten => s,n,MacroExit
exten => s,n(DidLogic),noop(== DIDLOGIC ==)
exten => s,n,MacroExit
It lets me do what I wanted and can grow if needed. Now all I need to do is put the CID I want into the extension with no quotes or brackets in 61812345678 form and the script will fix it for the selected provider. The names are just the trunk names I have in freepbx.
Andrew