]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 63286 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 7 May 2007 21:47:08 +0000 (21:47 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 7 May 2007 21:47:08 +0000 (21:47 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r63286 | file | 2007-05-07 17:45:01 -0400 (Mon, 07 May 2007) | 10 lines

Merged revisions 63285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63285 | file | 2007-05-07 17:39:52 -0400 (Mon, 07 May 2007) | 2 lines

Properly handle what happens during a masquerade in relation to group counting. (issue #9657 reported by ramonpeek)

........

................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63287 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index 15a2e5dadbef3f5e8ac692188add6b1ca39c8df2..e4eca117d8021a0ff19521131a5cc3d76f832865 100644 (file)
@@ -227,6 +227,9 @@ int ast_app_group_match_get_count(const char *groupmatch, const 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);
 
index 91441f64e3a265c0223f40b9d73b99a9b4bbb829..10b9fea809e0f7cd260d216cd9718bbdff5303d0 100644 (file)
@@ -894,6 +894,20 @@ int ast_app_group_match_get_count(const char *groupmatch, const 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 c92530c347603d47209fc1e4fa3c499743a1dc38..e48042793414f04da10fb0b3d51940ef4b795bef 100644 (file)
@@ -3575,7 +3575,7 @@ int ast_do_masquerade(struct ast_channel *original)
                        original->fds[x] = clone->fds[x];
        }
 
-       ast_app_group_discard(original);
+       ast_app_group_update(clone, original);
 
        /* move any whisperer over */
        ast_channel_whisper_stop(original);