I've just set up my Raspberry Pi as a call blocker.
It's based on a combination of jcblock (see sourceforge.net) and vgetty (the linux answering machine).
Jcblock (my compliments to its author) uses caller ID info via a modem to do a "pick-up-and-drop" on blacklisted numbers. In the UK caller ID info arrives before the first ring so the process is silent
The jcblock code needs some tweaking but it's trivial.
For withheld and unavailable callers I needed more functionality because some of these might be genuine calls and, for me, the "pick-up-and drop" method is undesirable. I installed vgetty just to get the "vm" command that can play (and record) voice messages. Withheld callers cause jcblock to use vm to answer and play my message asking them to redial without withholding their number.
Configuring vgetty is a pain because most of its wonderful modem database is now well out of date but I found my modem responded well to the V253 config. Quite a lot of source code hacking was required (for me anyway).
I added a button to the Pi so that I can add new numbers to the blacklist. So far the set-up seems to be working well. I had to change from a Conexant based modem to one from US robotics because the former seemed to keep missing caller ID signals.