aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-25 18:52:50 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-25 18:52:50 +0000
commit46218b546b269f611f3ab9558586e9091e6cc473 (patch)
treeefde09d37f3497fb38ebf4de92dc852dc5724c1e /channel.c
parent16ed3051f748e190ab73a2e326c958af9ab3e9a6 (diff)
Merge rewritten group counting support. No more storing data on the variable list of the channels. That was bad, mmmk? (issue #7497 reported by sabbathbh)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@61804 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/channel.c b/channel.c
index c218c437e..55276c9ec 100644
--- a/channel.c
+++ b/channel.c
@@ -954,6 +954,9 @@ void ast_channel_free(struct ast_channel *chan)
while ((vardata = AST_LIST_REMOVE_HEAD(headp, entries)))
ast_var_delete(vardata);
+ /* Drop out of the group counting radar */
+ ast_app_group_discard(chan);
+
free(chan);
ast_mutex_unlock(&chlock);
@@ -2920,22 +2923,6 @@ void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_
static void clone_variables(struct ast_channel *original, struct ast_channel *clone)
{
- struct ast_var_t *varptr;
-
- /* we need to remove all app_groupcount related variables from the original
- channel before merging in the clone's variables; any groups assigned to the
- original channel should be released, only those assigned to the clone
- should remain
- */
-
- AST_LIST_TRAVERSE_SAFE_BEGIN(&original->varshead, varptr, entries) {
- if (!strncmp(ast_var_name(varptr), GROUP_CATEGORY_PREFIX, strlen(GROUP_CATEGORY_PREFIX))) {
- AST_LIST_REMOVE_CURRENT(&original->varshead, entries);
- ast_var_delete(varptr);
- }
- }
- AST_LIST_TRAVERSE_SAFE_END;
-
/* Append variables from clone channel into original channel */
/* XXX Is this always correct? We have to in order to keep MACROS working XXX */
if (AST_LIST_FIRST(&clone->varshead))
@@ -3118,6 +3105,8 @@ int ast_do_masquerade(struct ast_channel *original)
for (x = 0; x < AST_MAX_FDS; x++) {
original->fds[x] = clone->fds[x];
}
+ /* Drop group from original */
+ ast_app_group_discard(original);
clone_variables(original, clone);
AST_LIST_HEAD_INIT_NOLOCK(&clone->varshead);
/* Presense of ADSI capable CPE follows clone */