Skip to content

Commit

Permalink
Fix hangup only if any call is running
Browse files Browse the repository at this point in the history
  • Loading branch information
artemkrachulov committed Oct 11, 2023
1 parent 742f6b5 commit 3c2abac
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions MatrixSDK/VoIP/MXCallManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,19 @@ - (void)handleCallInvite:(MXEvent *)event
if (call)
{

if (_callKitAdapter.maximumActiveCalls != -1 && calls.count >= _callKitAdapter.maximumActiveCalls) {
BOOL isOngoing = FALSE;
NSUInteger* runningCalls = 0;

[call hangupWithReason: MXCallHangupReasonUserBusy];
for (MXCall *call in calls) {
if (call.state <= MXCallStateConnected) {
runningCalls += 1;
}
}

if (_callKitAdapter.maximumActiveCalls != -1 && runningCalls >= _callKitAdapter.maximumActiveCalls) {

[call hangupWithReason: MXCallHangupReasonUserBusy];

return;
}

Expand Down

0 comments on commit 3c2abac

Please sign in to comment.