Setting Caller-ID by extension

I am trying to figure out the best way to set caller-id by extension? Below is my outbound routes:

[outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(SIP/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(SIP/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _00.,1,Dial(SIP/${EXTEN}@voipms)
exten => _00.,n,Hangup()

Is there a way I can create groups of extensions to reference for all entries?

exten => _1NXXNXXXXXX/ -(extension group?)- ,1,Set(CALLERID(all)=“John Doe” <1112223333>)

Any input would be appreciated.

For clarification, what you actually want to do is to set the outging caller ID according to the incoming caller ID?

Why do you need to do this? Most people would set the base caller ID in the device itself, or in the sip.conf entry for the device. Why can’t you algorithmically determine the outgoing ID from the incoming one?

I believe that pattern matches can be used in the caller-ID matching section of the first parameter of exten => lines. Also, the lines in a dialplan program don’t have to have exactly the same parameter, as long as there is a sequence of lines with consecutive numbers that match, or appropriate goto’s to skip missing numbers.