“This article describes how to build a Linux-based telephone answering machine using a low cost winmodem (softmodem) for the telephone interface. We describe how to install the drivers and libraries, and how to select and install the proper modem card. Our answering machine program is a couple of hundred lines of C code in a single file. If you’ve ever used a telephone you should have no trouble understanding the code.” Link.
Make a $10 Linux Answering Machine