[asterisk-commits] file: branch 1.2 r63285 - in /branches/1.2: ./ include/asterisk/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 7 14:39:52 MST 2007


Author: file
Date: Mon May  7 16:39:52 2007
New Revision: 63285

URL: http://svn.digium.com/view/asterisk?view=rev&rev=63285
Log:
Properly handle what happens during a masquerade in relation to group counting. (issue #9657 reported by ramonpeek)

Modified:
    branches/1.2/app.c
    branches/1.2/channel.c
    branches/1.2/include/asterisk/app.h

Modified: branches/1.2/app.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/app.c?view=diff&rev=63285&r1=63284&r2=63285
==============================================================================
--- branches/1.2/app.c (original)
+++ branches/1.2/app.c Mon May  7 16:39:52 2007
@@ -1111,6 +1111,20 @@
 	regfree(&regexbuf);
 
 	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)

Modified: branches/1.2/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channel.c?view=diff&rev=63285&r1=63284&r2=63285
==============================================================================
--- branches/1.2/channel.c (original)
+++ branches/1.2/channel.c Mon May  7 16:39:52 2007
@@ -3106,7 +3106,7 @@
 		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 */

Modified: branches/1.2/include/asterisk/app.h
URL: http://svn.digium.com/view/asterisk/branches/1.2/include/asterisk/app.h?view=diff&rev=63285&r1=63284&r2=63285
==============================================================================
--- branches/1.2/include/asterisk/app.h (original)
+++ branches/1.2/include/asterisk/app.h Mon May  7 16:39:52 2007
@@ -188,6 +188,9 @@
 /*! 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);
 



More information about the asterisk-commits mailing list