From: Anthony Minessale Date: Fri, 14 Oct 2011 12:14:39 +0000 (-0500) Subject: dup virtual fields on profiles as well X-Git-Tag: v1.2-rc1~27^2~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b1adc6a209792dc25c2beef7b71490d953d11ff;p=thirdparty%2Ffreeswitch.git dup virtual fields on profiles as well --- diff --git a/src/switch_caller.c b/src/switch_caller.c index da92ce649f..ac31d99d01 100644 --- a/src/switch_caller.c +++ b/src/switch_caller.c @@ -137,6 +137,29 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memor profile->pool = pool; profile->direction = tocopy->direction; + + if (tocopy->soft) { + profile_node_t *pn; + + for (pn = tocopy->soft; pn; pn = pn->next) { + profile_node_t *pp, *n = switch_core_alloc(profile->pool, sizeof(*n)); + + n->var = switch_core_strdup(profile->pool, pn->var); + n->val = switch_core_strdup(profile->pool, pn->val); + + if (!profile->soft) { + profile->soft = n; + } else { + for(pp = profile->soft; pp && pp->next; pp = pp->next); + + if (pp) { + pp->next = n; + } + } + } + + } + return profile; }