Fix incoming call with video option by notification

This commit is contained in:
Erwan Croze 2016-08-02 11:24:51 +02:00
parent a560a0ab85
commit d0aa3595ba
2 changed files with 6 additions and 4 deletions

View file

@ -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) {

View file

@ -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;
};
}