From df7633a521716ee0bc5b8ddb266f13e8be243f7b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 20 May 2025 10:19:12 -0400 Subject: [PATCH] MT#55283 fix regression from d3b944199 Report stats before monologues are removed from the hash table Closes #1940 Change-Id: Ie6efad41359450ce788cdcda307cda9a24bb6d6c NGCP-Flow: mr12.5 (cherry picked from commit 6bbf32e1d8ffdfdd2cf6da07ddcde88d45bf4de0) --- daemon/call.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 40f47893d..dd3c6fbdc 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4811,8 +4811,12 @@ int call_delete_branch(call_t *c, const str *branch, ml->term_reason = REGULAR; } - if (!fromtag || !fromtag->len) + if (!fromtag || !fromtag->len) { + if (output) + ng_call_stats(c, fromtag, totag, output, NULL); + goto del_all; + } if ((!totag || !totag->len) && branch && branch->len) { // try a via-branch match @@ -4859,6 +4863,9 @@ int call_delete_branch(call_t *c, const str *branch, do_delete: c->destroyed = rtpe_now; + if (output) + ng_call_stats(c, fromtag, totag, output, NULL); + /* stop media player and all medias of ml. * same for media subscribers */ monologue_stop(ml, true); @@ -4876,15 +4883,9 @@ do_delete: if (!del_stop) goto del_all; - if (output) - ng_call_stats(c, fromtag, totag, output, NULL); - goto success_unlock; del_all: - if (output) - ng_call_stats(c, fromtag, totag, output, NULL); - for (__auto_type i = c->monologues.head; i; i = i->next) { ml = i->data; monologue_stop(ml, false);