From 7c92a9c13098503540aee3298f4a44a641b11291 Mon Sep 17 00:00:00 2001 From: agree Date: Fri, 21 Jun 2024 13:56:03 -0400 Subject: [PATCH] [core] allow setting caller profile variables that shouldn't clone This allows setting a profile variable with a `local:` prefix, so the variable won't clone to subsequent cloned profiles. This is particularly useful for setting information on a caller profile for cdr use. --- src/switch_caller.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/switch_caller.c b/src/switch_caller.c index 37a3683039..3d7d9f82c3 100644 --- a/src/switch_caller.c +++ b/src/switch_caller.c @@ -162,6 +162,10 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memor for (pn = tocopy->soft; pn; pn = pn->next) { profile_node_t *pp, *n = switch_core_alloc(profile->pool, sizeof(*n)); + if (pn->var && !strncasecmp(pn->var, "local:", 6)) { + continue; + } + n->var = switch_core_strdup(profile->pool, pn->var); n->val = switch_core_strdup(profile->pool, pn->val);