diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index e7f2d5625..c5bc9847b 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -421,6 +421,17 @@ static RootViewManager *rootViewManagerInstance = nil; } } else { linphone_call_resume((LinphoneCall *)calls->data); + while (calls) { + if (linphone_call_get_state((LinphoneCall *)calls->data) == LinphoneCallIncomingReceived || + linphone_call_get_state((LinphoneCall *)calls->data) == LinphoneCallIncomingEarlyMedia) { + [self displayIncomingCall:(LinphoneCall *)calls->data]; + break; + } + calls = calls->next; + } + if (calls == NULL) { + [self changeCurrentView:CallView.compositeViewDescription]; + } } break; } diff --git a/Classes/ProviderDelegate.m b/Classes/ProviderDelegate.m index 96770e696..f3ea9e319 100644 --- a/Classes/ProviderDelegate.m +++ b/Classes/ProviderDelegate.m @@ -91,7 +91,10 @@ - (void)setPendingCall:(LinphoneCall *)pendingCall { if (pendingCall) { _pendingCall = pendingCall; + if (_pendingCall) + linphone_call_ref(_pendingCall); } else if (_pendingCall) { + linphone_call_unref(_pendingCall); _pendingCall = NULL; } } @@ -109,7 +112,7 @@ return; self.callKitCalls++; - _pendingCall = call; + [self setPendingCall:call]; } - (void)provider:(CXProvider *)provider performStartCallAction:(CXStartCallAction *)action {