From d2843d526ed4b1b9d0bc19b94dbfada07d428143 Mon Sep 17 00:00:00 2001 From: Svalorzen Date: Tue, 23 Feb 2016 11:27:31 +0100 Subject: [PATCH] Fixes infinite loop since if call redirection fails the calls don't actually get terminated. --- console/commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/console/commands.c b/console/commands.c index aaa72fa87..372eef24e 100644 --- a/console/commands.c +++ b/console/commands.c @@ -745,14 +745,16 @@ lpc_cmd_redirect(LinphoneCore *lc, char *args){ if (linphone_call_get_state(call)==LinphoneCallIncomingReceived){ if (linphone_core_redirect_call(lc,call,args) != 0) { linphonec_out("Could not redirect call.\n"); + elem=elem->next; + } else { + didit=1; + /*as the redirection closes the call, we need to re-check the call list that is invalidated.*/ + elem=linphone_core_get_calls(lc); } - didit=1; - /*as the redirection closes the call, we need to re-check the call list that is invalidated.*/ - elem=linphone_core_get_calls(lc); }else elem=elem->next; } if (didit==0){ - linphonec_out("There is no pending incoming call to redirect."); + linphonec_out("There is no pending incoming call to redirect.\n"); } return 1; }