I'm working for a social research firm that dials random numbers from the phone book. At least 1 in 5 are disconnected, and I'm told there is a way to electronically detect disconnected numbers without waiting for the recorded message.
I'm a database programmer, so I don't know much about telcos, but I'm guessing that either there is a different impedance across the pair when the exchange answers, or an inaudible frequency that indicates whether or not a number is live. That's all I can think of.
Someone solved this once before for my boss when he was at another company, but their code is proprietory, so I have to start again. I hope someone can help.