]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Mon, 7 May 2007 22:18:20 +0000 (22:18 +0000)
committerAutomerge Script <automerge@asterisk.org>
Mon, 7 May 2007 22:18:20 +0000 (22:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@63328 65c4cc65-6c06-0410-ace0-fbb531ad65f3

app.c
channel.c
include/asterisk/app.h

diff --git a/app.c b/app.c
index dd4a1853bffcf3acbb24bd884826c33dc281e9fd..f997752480f55f6b1a5cdadc4db0884b69d27730 100644 (file)
--- a/app.c
+++ b/app.c
@@ -1113,6 +1113,20 @@ int ast_app_group_match_get_count(char *groupmatch, char *category)
        return count;
 }
 
+int ast_app_group_update(struct ast_channel *old, struct ast_channel *new)
+{
+       struct ast_group_info *gi = NULL;
+
+       AST_LIST_LOCK(&groups);
+       AST_LIST_TRAVERSE(&groups, gi, list) {
+               if (gi->chan == old)
+                       gi->chan = new;
+       }
+       AST_LIST_UNLOCK(&groups);
+
+       return 0;
+}
+
 int ast_app_group_discard(struct ast_channel *chan)
 {
        struct ast_group_info *gi = NULL;
index 55276c9ec09ff7880dd082dbede3b8ec5d05f788..4c71ce3f62b8c2184cf6905011cb174e1840bb13 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -3106,7 +3106,7 @@ int ast_do_masquerade(struct ast_channel *original)
                original->fds[x] = clone->fds[x];
        }
        /* Drop group from original */
-       ast_app_group_discard(original);
+       ast_app_group_update(clone, original);
        clone_variables(original, clone);
        AST_LIST_HEAD_INIT_NOLOCK(&clone->varshead);
        /* Presense of ADSI capable CPE follows clone */
index b09cc8eb87d93415fa59110c7fe73b709272c5ae..98a78d2d0883eeebfd224acc4f71e6ef79170e48 100644 (file)
@@ -188,6 +188,9 @@ int ast_app_group_match_get_count(char *groupmatch, char *category);
 /*! Discard all group counting for a channel */
 int ast_app_group_discard(struct ast_channel *chan);
 
+/*! Update all group counting for a channel to a new one */
+int ast_app_group_update(struct ast_channel *old, struct ast_channel *new);
+
 /*! Lock the group count list */
 int ast_app_group_list_lock(void);