my favourite option would be with potential free realys (see topic here)
But in case is not possible to be potential free integration:
A) would the ring detection detect a positive 5V dc signal on yellow line?
B) what is the signal of the open line? does it output a dc Voltage that I can detect, and in this case, what is the voltage output, and maximum current output?