Answer 2nd line only if 1st line is in use

I have two POTS lines going into two FXO ports on a Digium TDM400 card.

I want to set up Asterisk so that it monitors line 2 (and answers, if called) ONLY if line 1 is in use. If line 1 is NOT in use, I want it to totally ignore line 2.

Any way of doing that?

could do that on the dialplan with chanisavail() i thinkā€¦