How to prevent cancellation of registration by asterisk

I have problem with my IP-phones which sometimes drops SIP-requests (retransmission timeout reached). At such moments asterisk thinks the phone unreachable and instantly cancels its registration (without waiting expiry timeuot). I had turn off the “qualify” function but the problem remained. How can I get asterisk to prevent cancellation of registration despite everything?
I’m using asterisk 13.