I've got a FreePBX/Asterisk VoIP PBX and I've thought about running TeleCrapper2000 (https://hackaday.com/2005/09/08/telecrapper-2000/), but a better solution is to just put Google Voice in front of it and turn on "Screen Calls". It does a very effective (although not 100%) job of eliminating most robo/sales calls.