]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 63285 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 7 May 2007 21:45:01 +0000 (21:45 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 7 May 2007 21:45:01 +0000 (21:45 +0000)
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/branches/1.4@63286 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index 2106fe6b3aeff4d7e434fdd1b88f9a57dfcc0d74..1c6dca0e7ae55b71511f1ea140869d96df3df4ad 100644 (file)
@@ -225,6 +225,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 ef25e1ba5469006b2cdfd96152ea249969f9d7c2..89fdb26d4bfffbf68613e8bdf5b8bd35123d8f32 100644 (file)
@@ -872,6 +872,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 bf1c9fec841291573c44c71b47a7be3331267e7e..5c5b4899cf15c4d007fbbf09c2c0ed81bd854632 100644 (file)
@@ -3611,7 +3611,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);