Not called from other asterisk during a telephone call

Although PBX is used using two sets of asterisk, my extension will also be called if the 2nd set receives a message in the midst of talking over the telephone by telephone of the 1st set of asterisk.
Isn’t there any method which is not called from other asterisk during a telephone call?

You mean device, not extension.

On the basis that people who don’t specify the technology are normally using SIP, I’ll assume that.

This is an unusual requirement. I don’t think that the Asterisk’s can accept presence information from the phones. They may be able to accept it from each other, using a relatively new (non-SIP) feature. If so, you could test the device state before forwarding the message.