Hangup call early if another device of same account has acepted call

I'm using PushKit + CallKit and Agora for my app video call feature. So far everything works as expected, but I'm not entirely sure how to handle the following situtation:

Given:
User A (with account A1) logs into device 1, 2 and 3.
User B (with Account B1) logs into device 4 and calls user A via an in-app video call feature.

At the moment:
Devices 1, 2 and 3 all ring given the condition above. User A accepts the call via device 2. Device 1 and 3 continue to ring (which is expected) until timeout or picked up.

What I want:
I would like to end the call/ring on device 1 and 3, as soon as user A accepts the call via device 2. Currently there is a timeout, but I dont want to rely on that.

Is there an elegant way to handle this? I was thinking about letting device 2 notify my api server that it has accepted the call, so that the server can notifies device 1 and 3 to end the call/hang up early.
Using another VoIP notification in this case might not work, because I read via Apple docs that all VoIP Notification handler call must use reportNewIncomingCall(with:update:completion:) to report an incoming to call to the system or risk getting shut down otherwise.

Accepted Reply

I figured this out. Basically, I send a 2nd VoIP Push (with a slightly different payload to signal this is a Push to end call early) and let the client invoke requestTransaction:completion: (along with an end call transaction) to end call early.

So I believe as long as the pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler: invokes reportNewIncomingCallWithUUID:update:completion: or requestTransaction:completion:, then the app won't get shutdown.

My original concern is still legit when targeting iOS13.0. It's because when I tested the scenario where VoIP Push is received and I do not report incoming call or notify the call system anything, the app did get shut down.

Replies

I figured this out. Basically, I send a 2nd VoIP Push (with a slightly different payload to signal this is a Push to end call early) and let the client invoke requestTransaction:completion: (along with an end call transaction) to end call early.

So I believe as long as the pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler: invokes reportNewIncomingCallWithUUID:update:completion: or requestTransaction:completion:, then the app won't get shutdown.

My original concern is still legit when targeting iOS13.0. It's because when I tested the scenario where VoIP Push is received and I do not report incoming call or notify the call system anything, the app did get shut down.