Disconnecting connections

Hi. What command to reject an incoming call after a few seconds? The idea is that the number will appear with the time of the call attempt, but in order not to ring the phone I would still like to reject after the allotted time of the attempt to make a call. Thank you in advance for your help. Krzychu

Rejecting an incoming call after a few seconds is not possible using Blocks. Break incoming phone call .

A possible Android Studio Java solution was once possible: Can I hang up a call programmatically in android? - Stack Overflow but might no longer be possible.