Caller ID

It sure is a bitch!

What? It's phase-coherent FSK modulated? Motherfucker!

Well, with that news, my happy thought of building a hardware device to decode it went out the window. The only advice I could find on the internet, to the effect of "just use a phase locked loop," is a complete fucking joke. You can't phase-lock to a frequency you only see one or two cycles of before it switches to something else. So how is the magic of decoding this bullshit done in hardware? I haven't a clue.

Software time!

So I just attached my phone line to my sound card. I didn't directly connect it, naturally, since the ringer voltage is a nice 120 volts 20 Hz AC or something like that. That's not good for sound cards. The circuit it is currently connected with is a piece of shit no one would be able to reproduce, so there's no point in posting it. Maybe if I create a better one some day...

Anyway, I couldn't find any existing code to demodulate the data from the sound card input, so I had to write my own. ...and since I assume you found this page because you do not wish to write your own code, you'll be happy to know that you can compile mine like this:
gcc -std=gnu99 -o caller_id_demodulator caller_id_demodulator.c -lm
Then you can try it out like this:
sox sample.wav -t raw -c 1 -r 9600 -e signed-integer -b 16 - | ./caller_id_demodulator
Then you can use it like this:
rec -t raw -c 1 -r 9600 -e signed-integer -b 16 - | ./caller_id_demodulator
It will probably spit out a lot of errors, but the important thing is that it spits out the Caller ID messages as well. The errors are due to the fact that I didn't feel like writing a bunch more code to properly detect when Caller ID packets were being sent, so it kind of just tries to decode anything that sort of looks right. Filter it through grep -v Error: if the error messages bother you. ...or, hell, you have the source code. Just delete the relevant printf() lines, you lazy bastard.