CallKit counts its calls

This commit is contained in:
Benjamin Reis 2017-02-23 10:26:42 +01:00
parent e29817b4ef
commit 03540a8b69
3 changed files with 7 additions and 1 deletions

View file

@ -2624,7 +2624,8 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
}
if (linphone_core_get_calls_nb(theLinphoneCore) < 1 &&
floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max) {
floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max &&
self.providerDelegate.callKitCalls < 1) {
NSUUID *uuid = [NSUUID UUID];
[LinphoneManager.instance.providerDelegate.uuids setObject:uuid forKey:@""];
LinphoneManager.instance.providerDelegate.pendingAddr = linphone_address_clone(iaddr);

View file

@ -21,6 +21,7 @@
@property LinphoneCall *pendingCall;
@property LinphoneAddress *pendingAddr;
@property BOOL pendingCallVideo;
@property int callKitCalls;
- (void)reportIncomingCallwithUUID:(NSUUID *)uuid handle:(NSString *)handle video:(BOOL)video;
- (void)config;

View file

@ -25,6 +25,7 @@
CXCallController *callController = [[CXCallController alloc] initWithQueue:dispatch_get_main_queue()];
[callController.callObserver setDelegate:self queue:dispatch_get_main_queue()];
self.controller = callController;
self.callKitCalls = 0;
if (!self) {
LOGD(@"ProviderDelegate not initialized...");
@ -77,6 +78,7 @@
- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action {
LOGD(@"CallKit : Answering Call");
self.callKitCalls++;
[self configAudioSession:[AVAudioSession sharedInstance]];
[action fulfill];
NSUUID *uuid = action.callUUID;
@ -95,6 +97,7 @@
- (void)provider:(CXProvider *)provider performStartCallAction:(CXStartCallAction *)action {
LOGD(@"CallKit : Starting Call");
self.callKitCalls++;
// To restart Audio Unit
[self configAudioSession:[AVAudioSession sharedInstance]];
[action fulfill];
@ -114,6 +117,7 @@
- (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)action {
LOGD(@"CallKit : Ending the Call");
self.callKitCalls--;
[action fulfill];
if (linphone_core_is_in_conference(LC)) {
LinphoneManager.instance.conf = TRUE;