You need to create a context in extensions_custom.conf with an arbitrary name like this:
[from-pstn-preprocess]
exten => _./1234567890,1,Set(CALLERID(name)=NewName1) ; all inbound calls matching cid number 1234567890
exten => _./9876543210,1,Set(CALLERID(name)=NewName2) ; all inbound calls matching cid number 9876543210
; additional set lines as required
exten => _.,1,NoOp(Entering user defined context from-pstn-preprocess in extensions_custom.conf) ; Catch all other cases
exten => _.,n,goto(from-pstn,${EXTEN},1))
Then edit your trunk(s) and set the context to from-pstn-preprocess
. You can set as many priority 1 lines as you want for each different CID number.