From 20bd3daffc8630a1c1185d1c9995319abd5d1be7 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 25 Jun 2026 08:02:58 -0400 Subject: [PATCH] MT#65392 add "fast" flag for delete processing Change-Id: I16d4cdd9ecc8dbe612eac2ff002283b606f0f082 (cherry picked from commit 6391c6bf9525aa296736cb3e0a5f43f349d52c09) (cherry picked from commit 34d8c9053abef101ab5e5fefd47ecf81c3135935) --- daemon/call.c | 9 +++++---- daemon/call_interfaces.c | 6 +++++- docs/ng_control_protocol.md | 6 ++++++ include/call.h | 3 ++- include/call_interfaces.h | 1 + utils/rtpengine-ng-client | 1 + 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index bccccd04e..929142bf3 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -5303,7 +5303,8 @@ static void monologue_stop(struct call_monologue *ml, bool stop_media_subsribers // call must be locked in W. // unlocks the call and releases the reference prior to returning, even on error. int call_delete_branch(call_t *c, const str *branch, - const str *fromtag, const str *totag, ng_command_ctx_t *ctx, int64_t delete_delay) + const str *fromtag, const str *totag, ng_command_ctx_t *ctx, int64_t delete_delay, + bool stats) { struct call_monologue *ml; int ret; @@ -5386,13 +5387,13 @@ do_delete: if (!del_stop) goto del_all; - if (ctx) + if (ctx && stats) ng_call_stats(ctx, c, fromtag, totag, NULL); goto success_unlock; del_all: - if (ctx) + if (ctx && stats) ng_call_stats(ctx, c, NULL, NULL, NULL); for (__auto_type i = c->monologues.head; i; i = i->next) { @@ -5443,7 +5444,7 @@ int call_delete_branch_by_id(const str *callid, const str *branch, ilog(LOG_INFO, "Call-ID to delete not found"); return -1; } - return call_delete_branch(c, branch, fromtag, totag, ctx, delete_delay); + return call_delete_branch(c, branch, fromtag, totag, ctx, delete_delay, false); } struct call_media *call_make_transform_media(struct call_monologue *ml, const str *type, enum media_type type_id, diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index ba3641b8c..6b310d684 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1128,6 +1128,9 @@ void call_ng_flags_flags(str *s, unsigned int idx, helper_arg arg) { case CSH_LOOKUP("fatal"): out->fatal = true; break; + case CSH_LOOKUP("fast"): + out->fast = true; + break; case CSH_LOOKUP("fragment"): out->fragment = true; break; @@ -2702,7 +2705,8 @@ const char *call_delete_ng(ng_command_ctx_t *ctx) { if (call_delete_branch(c, &rtpp_flags.via_branch, &rtpp_flags.from_tag, (rtpp_flags.to_tag_flag ? &rtpp_flags.to_tag : NULL), - ctx, rtpp_flags.delete_delay)) + ctx, rtpp_flags.delete_delay, + !rtpp_flags.fast)) { goto err; } diff --git a/docs/ng_control_protocol.md b/docs/ng_control_protocol.md index 52f6f73a5..24f364d2c 100644 --- a/docs/ng_control_protocol.md +++ b/docs/ng_control_protocol.md @@ -1699,6 +1699,12 @@ of zero or more strings. The following flags are defined: result in an error reply (i.e. `"result": "error"`). The default is to reply with a warning only (i.e. `"result": "ok", "warning": ...`). +* `fast` + + Omit adding statistics to the response message. This makes processing of + the delete message more light-weight and produces a smaller response + message, which is beneficial if the statistics aren't needed. + * `to-tag` This flag controls whether the `"To"` tag's value is honoured or ignored when handling diff --git a/include/call.h b/include/call.h index 8aba1f338..db87a98e8 100644 --- a/include/call.h +++ b/include/call.h @@ -866,7 +866,8 @@ void monologue_destroy(struct call_monologue *ml); int call_delete_branch_by_id(const str *callid, const str *branch, const str *fromtag, const str *totag, ng_command_ctx_t *, int64_t delete_delay); int call_delete_branch(call_t *, const str *branch, - const str *fromtag, const str *totag, ng_command_ctx_t *, int64_t delete_delay); + const str *fromtag, const str *totag, ng_command_ctx_t *, int64_t delete_delay, + bool stats); void call_destroy(call_t *); struct call_media *call_media_new(call_t *call); void call_media_free(struct call_media **mdp); diff --git a/include/call_interfaces.h b/include/call_interfaces.h index e7e97b499..2d1d550f3 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -285,6 +285,7 @@ RTPE_NG_FLAGS_STR_CASE_HT_PARAMS pierce_nat:1, directional:1, fatal:1, + fast:1, new_branch:1, provisional:1, /* to_tag is used especially by delete handling */ diff --git a/utils/rtpengine-ng-client b/utils/rtpengine-ng-client index 1fb29a5c5..bab4b55d8 100755 --- a/utils/rtpengine-ng-client +++ b/utils/rtpengine-ng-client @@ -55,6 +55,7 @@ my @flags = qw( block-egress directional allow-no-codec-media + fast ); my @string_opts = qw(