From d0aa3595ba3fba35ee36a62e36fcfa86604b8af5 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 2 Aug 2016 11:24:51 +0200 Subject: [PATCH] Fix incoming call with video option by notification --- Classes/LinphoneAppDelegate.m | 6 +++--- Classes/LinphoneManager.m | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index fa82f1d78..8e9b01daa 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -361,13 +361,13 @@ [self fixRing]; if ([notification.userInfo objectForKey:@"callId"] != nil) { - BOOL auto_answer = TRUE; + BOOL bypass_incoming_view = TRUE; // some local notifications have an internal timer to relaunch themselves at specified intervals if ([[notification.userInfo objectForKey:@"timer"] intValue] == 1) { [LinphoneManager.instance cancelLocalNotifTimerForCallId:[notification.userInfo objectForKey:@"callId"]]; - auto_answer = [LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"]; + bypass_incoming_view = [LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"]; } - if (auto_answer) { + if (bypass_incoming_view) { [LinphoneManager.instance acceptCallForCallId:[notification.userInfo objectForKey:@"callId"]]; } } else if ([notification.userInfo objectForKey:@"from_addr"] != nil) { diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 01d1f9464..33f7d4110 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1611,7 +1611,9 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) { MSList *calls = (MSList *)linphone_core_get_calls(theLinphoneCore); MSList *call = ms_list_find_custom(calls, (MSCompareFunc)comp_call_id, [callid UTF8String]); if (call != NULL) { - [self acceptCall:(LinphoneCall *)call->data evenWithVideo:YES]; + const LinphoneVideoPolicy *video_policy = linphone_core_get_video_policy(theLinphoneCore); + bool with_video = video_policy->automatically_accept; + [self acceptCall:(LinphoneCall *)call->data evenWithVideo:with_video]; return; }; }