From deeb67836366b61ea2075d7177368de40372c2dd Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 10 Jan 2017 10:34:07 +0100 Subject: [PATCH] Cancel timer when auto-answe to notificationr --- Classes/LinphoneAppDelegate.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 2c2682b0e..69660ef11 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -110,6 +110,11 @@ } instance->currentCallContextBeforeGoingBackground.call = 0; } else if (linphone_call_get_state(call) == LinphoneCallIncomingReceived) { + LinphoneCallAppData *data = (__bridge LinphoneCallAppData *)linphone_call_get_user_data(call); + if (data && data->timer) { + [data->timer invalidate]; + data->timer = nil; + } if ((floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max)) { if ([LinphoneManager.instance lpConfigBoolForKey:@"autoanswer_notif_preference"]) { linphone_core_accept_call(LC, call);