You would need to define "known" and "unknown". Since all we have is CLID (and maybe not even that with analogue lines), then you would need to provide a pool of known caller-ids. Assuming you have that, then it is trivial to create a custom app to do a look-up and make a routing decision. If you give us more context on the question then maybe we can give you a better answer than we just have.
Kind Regards
S