From 177b4111c2f37688e84630ebc621f71c6e774bae Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Wed, 12 Apr 2023 11:45:06 +0200 Subject: [PATCH] MT#57118 Don't destroy a whole call, if only a branch is to be destroyed Upon calling the `monologue_delete_iter()`, we have to take into account an amount of forked legs we have now entirely in the call. If there's more than 1 forked leg, don't mark the whole call for a full destruction, since other forks might be successful (and they are not in a scope of processing now). Only destroy this branch and associated to it monologue(s). Change-Id: I6fdb4ba33ae7582578d84d57d91f9536d932ca47 --- daemon/call.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index 2e74439c7..39dfac134 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4276,6 +4276,7 @@ static unsigned int monologue_delete_iter(struct call_monologue *a, int delete_d if (!call) return 0; + unsigned int call_viabranches_count = g_hash_table_size(call->viabranches); GList *associated = g_hash_table_get_values(a->associated_tags); unsigned int ret = 0; @@ -4304,6 +4305,13 @@ static unsigned int monologue_delete_iter(struct call_monologue *a, int delete_d ret |= 0x1; } + /* Take into account an amount of forked legs we have now. + * If there's more than 1 forked leg, don't mark the call for a full destruction, + * since other forks might be successful. Only destroy this branch and associated to it monologue(s). + */ + if (call_viabranches_count > 1) + ret |= 0x1; + g_list_free(associated); return ret; }