Phrack is a hacking publication that often has tutorial articles on how the PSTN phone system works, and build it yourself telephone devices.
For example: Automatically answer a phone line

Created by: jht2, Last modification: Tue 04 of Apr, 2006 (05:37 UTC) by kaos
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+