diff --git a/daemon/call.c b/daemon/call.c index 92f6866af..b6c12851e 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4873,9 +4873,6 @@ int call_delete_branch(call_t *c, const str *branch, do_delete: c->destroyed = rtpe_now; - if (ctx) - ng_call_stats(ctx, c, fromtag, totag, NULL); - /* stop media player and all medias of ml. * same for media subscribers */ monologue_stop(ml, true); @@ -4893,9 +4890,15 @@ do_delete: if (!del_stop) goto del_all; + if (ctx) + ng_call_stats(ctx, c, fromtag, totag, NULL); + goto success_unlock; del_all: + if (ctx) + ng_call_stats(ctx, c, NULL, NULL, NULL); + for (__auto_type i = c->monologues.head; i; i = i->next) { ml = i->data; monologue_stop(ml, false);