Fixes infinite loop since if call redirection fails the calls don't actually get terminated.

This commit is contained in:
Svalorzen 2016-02-23 11:27:31 +01:00 committed by Gautier Pelloux-Prayer
parent 4eced3bf2a
commit d2843d526e

View file

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