Status Line

Hello. Right now I am developing a custom Dial app that just Dial a phone, get status information about the line, and then hungup, for example to detect if the line is in service. But what I want is that the other end and dont ring. How can I say to the phone that don’t ring?? I am working with dsp.c, How Can I detect line out of service, I just know that is tree-tone signal??
Thanks