There is a context in /etc/asterisk/extensions.conf
; from-did-direct:
;
; forces ext-findmefollow to take precedence over ext-local. Also exposed to
; the public side to allow an extension number to be used as an external DID
; without requiring inbound routes to be created, common in many PRI installations
; where the last 4 digits are used as the extnension and DIDs are delivered in
; 4 digit formats.
;
[from-did-direct]
include => ext-findmefollow
include => ext-local
;-------------------------------------------------------------------------------
this will send incoming did calls to matching internal extensions, you can modify the CallerID(number) at the beginning of such a context if the mapping is not “1-to-1” but there is a recognizable connection between the two.