From d3b944199cfe936db298f4bf7365a08a3ae6483f Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 14 Oct 2024 10:09:40 -0400 Subject: [PATCH] MT#61263 fix `delete` stats reporting Make sure stats are always added to the `delete` message. Fixes stats being missing in case of `delete` without from-tag. Change-Id: I635cc87b91d3e488696f33380b12dc68a24e51ad (cherry picked from commit 7b28ec440231c45c052dbd1d6e6e798c19d42c08) (cherry picked from commit 8ddc11b2e552b21aef21b3de73a6832aaecaa0cc) --- daemon/call.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index fa2db9eb2..619508bcf 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4814,9 +4814,6 @@ 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); @@ -4834,9 +4831,15 @@ 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);