Android Q has introduced CallRedirectionService
API - seems like one of the way 3rd party apps can use it is to cancel calls and reroute them over VoIP - essentiall
The problem is that at the moment documentation is not full and sample in documentation is not correct. To fix this, in your AndroidManifest it is needed to change
android:permission="android.permission.BIND_REDIRECTION_SERVICE"
to
android:permission="android.permission.BIND_CALL_REDIRECTION_SERVICE"
This permission is incorrectly written inside the google documentation for https://developer.android.com/reference/android/telecom/CallRedirectionService.html currently.
Also, it is required to ask user to allow your application play this role. In google documentation this part missing at the moment :
RoleManager roleManager = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
roleManager = (RoleManager) getSystemService(Context.ROLE_SERVICE);
Intent intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_CALL_REDIRECTION);
startActivityForResult(intent, 1);}