Outbound caller id per extension

kinda newbie question, but i am stuck with the caller id of the extensions.
i do have a sip trunk that has 5 numbers (000, …, 004), default is 000 number.
all of my users at the moment are using the default number of the trunk 000, but i would like to define my users 400-420 have their caller id:
-extensions 400-409 they will have 001 as incoming and outgoing number
-extensions 410-415 they will have 002 as incoming and outgoing number
-extensions 416-418 they will have 003 as incoming and outgoing number
-extension 419 will have 004 as incoming and outgoing number
-extension 420 will have 000 as incoming and outgoing number

please some help to differentiate my users caller id.
i am running asterisk 11.3

You will need to modify the CallerID in the Dialplan before you send the call to SIP Trunk. For this I personally use AstDB where I save “Extension <=> Public Number” pairs.
You can change the CallerID number with:

Set(CALLERID(num)=number_or_variable)

may i have an example please?

;get CallerID that provider needs from AstDB
exten => _ZXXXXXX,1,Set(Ext_DID=${DB(usr/${CALLERID(num)}/DID)})
;replace CallerID
exten => _ZXXXXXX,n,Set(CALLERID(num)=${Ext_DID})
;make a call to dialed number
exten => _ZXXXXXX,n,Dial(SIP/${EXTEN},40,t)