File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ API_AVAILABLE(ios(10.0))
5959 */
6060+ (BOOL )callKitAvailable;
6161
62+ /* *
63+ The maximum number of calls.
64+
65+ Defaults is -1. Any count
66+ */
67+ @property (nonatomic) NSUInteger maximumActiveCalls;
68+
69+
6270@end
6371
6472NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ - (instancetype)initWithConfiguration:(MXCallKitConfiguration *)configuration
6868 _callController = [[CXCallController alloc ] initWithQueue: dispatch_get_main_queue ()];
6969
7070 _calls = [NSMutableDictionary dictionary ];
71+
72+ _maximumActiveCalls = -1 ;
7173 }
7274
7375 return self;
Original file line number Diff line number Diff line change @@ -490,6 +490,14 @@ - (void)handleCallInvite:(MXEvent *)event
490490 call = [[MXCall alloc ] initWithRoomId: nativeRoomId callSignalingRoomId: event.roomId andCallManager: self ];
491491 if (call)
492492 {
493+
494+ if (_callKitAdapter.maximumActiveCalls != -1 && calls.count >= _callKitAdapter.maximumActiveCalls ) {
495+
496+ [call hangupWithReason: MXCallHangupReasonUserBusy];
497+
498+ return ;
499+ }
500+
493501 [calls addObject: call];
494502
495503 [call handleCallEvent: event];
You can’t perform that action at this time.
0 commit comments