Deny call if one SIP channel was BUSY

Hello everybody.
I do not know how to achieve this kind of extension.

So, I have Asterisk 1.4.35.
We have two SIP phones.

And now, I have a one special public numer.
Someone is calling that number, and next the extensions should make SIP call to the two SIP phones but ONLY if both of them are not busy.

So, how does should look the extension, which will allow the call to the 301 and 302, but only if two of these phones are not busy. If one of them was busy, go to s,n,Hangup .

;exten => s,1,Ringing
;exten => s,n,Wait(2)

if two phones are not busy, go to s,3 - but if one of the phones was busy, go to s,n,Hangup

;exten => s,n,Dial(SIP/301&SIP/302,15,thwk)
;exten => s,n,Goto(s-${DIALSTATUS},1)
;exten => s-BUSY,1,Playback(local/linie_sa_zajete)
;exten => s-NOANSWER,1,Playback(local/linie_sa_zajete)
;exten => s-CHANUNAVAIL,1,Playback(local/linie_sa_zajete)
;exten => _s-.,n,Hangup
;exten => s,n,Hangup

Thank you for your help, best regards.