[asterisk-commits] rmudgett: branch rmudgett/bridge_tasks r390314 - /team/rmudgett/bridge_tasks/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 31 12:31:42 CDT 2013


Author: rmudgett
Date: Fri May 31 12:31:40 2013
New Revision: 390314

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390314
Log:
Some light ConfBridge refactoring.

* Remove some unneeded state machine entry routines that did nothing.

* Removed a redundant action in INACTIVE state join_marked event.

* Made MULTI_MARKED state call some standard actions instead of inlining
them.

Modified:
    team/rmudgett/bridge_tasks/apps/confbridge/conf_state_inactive.c
    team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi.c
    team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi_marked.c

Modified: team/rmudgett/bridge_tasks/apps/confbridge/conf_state_inactive.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_tasks/apps/confbridge/conf_state_inactive.c?view=diff&rev=390314&r1=390313&r2=390314
==============================================================================
--- team/rmudgett/bridge_tasks/apps/confbridge/conf_state_inactive.c (original)
+++ team/rmudgett/bridge_tasks/apps/confbridge/conf_state_inactive.c Fri May 31 12:31:40 2013
@@ -38,7 +38,6 @@
 static void join_unmarked(struct confbridge_user *user);
 static void join_marked(struct confbridge_user *user);
 static void leave_waitmarked(struct confbridge_user *user);
-static void transition_to_inactive(struct confbridge_user *user);
 
 struct confbridge_state STATE_INACTIVE = {
 	.name = "INACTIVE",
@@ -46,7 +45,6 @@
 	.join_waitmarked = conf_default_join_waitmarked,
 	.join_marked = join_marked,
 	.leave_waitmarked = leave_waitmarked,
-	.entry = transition_to_inactive,
 };
 struct confbridge_state *CONF_STATE_INACTIVE = &STATE_INACTIVE;
 
@@ -61,7 +59,6 @@
 static void join_marked(struct confbridge_user *user)
 {
 	conf_add_user_marked(user->conference, user);
-	conf_handle_second_active(user->conference);
 
 	conf_change_state(user, CONF_STATE_MULTI_MARKED);
 }
@@ -73,8 +70,3 @@
 		conf_change_state(user, CONF_STATE_EMPTY);
 	}
 }
-
-static void transition_to_inactive(struct confbridge_user *user)
-{
-	return;
-}

Modified: team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi.c?view=diff&rev=390314&r1=390313&r2=390314
==============================================================================
--- team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi.c (original)
+++ team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi.c Fri May 31 12:31:40 2013
@@ -38,7 +38,6 @@
 static void join_unmarked(struct confbridge_user *user);
 static void join_marked(struct confbridge_user *user);
 static void leave_unmarked(struct confbridge_user *user);
-void transition_to_multi(struct confbridge_user *user);
 
 struct confbridge_state STATE_MULTI = {
 	.name = "MULTI",
@@ -47,7 +46,6 @@
 	.join_marked = join_marked,
 	.leave_unmarked = leave_unmarked,
 	.leave_waitmarked = conf_default_leave_waitmarked,
-	.entry = transition_to_multi,
 };
 struct confbridge_state *CONF_STATE_MULTI = &STATE_MULTI;
 
@@ -70,8 +68,3 @@
 		conf_change_state(user, CONF_STATE_SINGLE);
 	}
 }
-
-void transition_to_multi(struct confbridge_user *user)
-{
-	return;
-}

Modified: team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi_marked.c?view=diff&rev=390314&r1=390313&r2=390314
==============================================================================
--- team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi_marked.c (original)
+++ team/rmudgett/bridge_tasks/apps/confbridge/conf_state_multi_marked.c Fri May 31 12:31:40 2013
@@ -99,10 +99,8 @@
 				ast_bridge_remove(user_iter->conference->bridge, user_iter->chan);
 			} else if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED) &&
 					!ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
-				AST_LIST_REMOVE_CURRENT(list);
-				user_iter->conference->activeusers--;
-				AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
-				user_iter->conference->waitingusers++;
+				conf_remove_user_active(user_iter->conference, user_iter);
+				conf_add_user_waiting(user_iter->conference, user_iter);
 				/* Handle muting/moh of user_iter if necessary */
 				if (ast_test_flag(&user_iter->u_profile, USER_OPT_MUSICONHOLD)) {
 					ast_bridge_mute_set(user_iter->conference->bridge, user_iter->chan, 1);




More information about the asterisk-commits mailing list