]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
dup virtual fields on profiles as well
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 14 Oct 2011 12:14:39 +0000 (07:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 14 Oct 2011 12:14:45 +0000 (07:14 -0500)
src/switch_caller.c

index da92ce649fbb241ea37e0eed4f5e13aaa589ef41..ac31d99d01115ce7d11183a5d6cb57176ce44add 100644 (file)
@@ -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;
 }