[asterisk-commits] dvossel: branch dvossel/hd_confbridge r310886 - in /team/dvossel/hd_confbridg...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 16 11:51:35 CDT 2011


Author: dvossel
Date: Wed Mar 16 11:51:32 2011
New Revision: 310886

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=310886
Log:
Addition of the 'leave_conference' menu action

Modified:
    team/dvossel/hd_confbridge/apps/app_confbridge.c
    team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
    team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
    team/dvossel/hd_confbridge/configs/confbridge.conf.sample
    team/dvossel/hd_confbridge/main/bridging.c

Modified: team/dvossel/hd_confbridge/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/app_confbridge.c?view=diff&rev=310886&r1=310885&r2=310886
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Wed Mar 16 11:51:32 2011
@@ -1171,6 +1171,11 @@
 				ao2_unlock(conference_bridge);
 			}
 			break;
+		case MENU_ACTION_LEAVE:
+			ao2_lock(conference_bridge);
+			ast_bridge_remove(conference_bridge->bridge, bridge_channel->chan);
+			ao2_unlock(conference_bridge);
+			break;
 		}
 	}
 	return res;
@@ -1201,8 +1206,6 @@
 		ast_moh_start(bridge_channel->chan, conference_bridge_user->u_profile.moh_class, NULL);
 	}
 	ao2_unlock(conference_bridge);
-
-	bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_WAIT;
 
 	return res;
 }

Modified: team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c?view=diff&rev=310886&r1=310885&r2=310886
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Wed Mar 16 11:51:32 2011
@@ -280,6 +280,7 @@
 	case MENU_ACTION_DECREASE_TALKING:
 	case MENU_ACTION_ADMIN_TOGGLE_LOCK:
 	case MENU_ACTION_ADMIN_KICK_LAST:
+	case MENU_ACTION_LEAVE:
 		break;
 	case MENU_ACTION_PLAYBACK:
 	case MENU_ACTION_PLAYBACK_AND_CONTINUE:
@@ -352,6 +353,8 @@
 		res |= add_action_to_menu_entry(menu_entry, MENU_ACTION_ADMIN_TOGGLE_LOCK, NULL);
 	} else if (!strcasecmp(action, "admin_kick_last")) {
 		res |= add_action_to_menu_entry(menu_entry, MENU_ACTION_ADMIN_KICK_LAST, NULL);
+	} else if (!strcasecmp(action, "leave_conference")) {
+		res |= add_action_to_menu_entry(menu_entry, MENU_ACTION_LEAVE, NULL);
 	} else if (!strncasecmp(action, "dialplan_exec", 13)) {
 		action_args = ast_strdupa(action);
 		if ((action_args = strchr(action, '(')) && (tmp = strrchr(action_args, ')'))) {
@@ -681,6 +684,9 @@
 			case MENU_ACTION_ADMIN_KICK_LAST:
 				ast_cli(a->fd, "admin_kick_last");
 				break;
+			case MENU_ACTION_LEAVE:
+				ast_cli(a->fd, "leave_conference");
+				break;
 			}
 			action_num++;
 		}

Modified: team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h?view=diff&rev=310886&r1=310885&r2=310886
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h Wed Mar 16 11:51:32 2011
@@ -61,6 +61,7 @@
 	MENU_ACTION_DIALPLAN_EXEC,
 	MENU_ACTION_ADMIN_TOGGLE_LOCK,
 	MENU_ACTION_ADMIN_KICK_LAST,
+	MENU_ACTION_LEAVE,
 };
 
 /*! The conference menu action contains both

Modified: team/dvossel/hd_confbridge/configs/confbridge.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/configs/confbridge.conf.sample?view=diff&rev=310886&r1=310885&r2=310886
==============================================================================
--- team/dvossel/hd_confbridge/configs/confbridge.conf.sample (original)
+++ team/dvossel/hd_confbridge/configs/confbridge.conf.sample Wed Mar 16 11:51:32 2011
@@ -101,6 +101,8 @@
                                          ; commands in the dialplan.  Once the dialplan
                                          ; exits the user will be put back into the
                                          ; conference.  The possibilities are endless!
+; leave_conference ; This action allows a user to exit the conference and continue
+                   ; execution in the dialplan.
 ;
 ; admin_kick_last  ; This action allows an Admin to kick the last participant from the
                    ; conference. This action will only work for admins which allows

Modified: team/dvossel/hd_confbridge/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/main/bridging.c?view=diff&rev=310886&r1=310885&r2=310886
==============================================================================
--- team/dvossel/hd_confbridge/main/bridging.c (original)
+++ team/dvossel/hd_confbridge/main/bridging.c Wed Mar 16 11:51:32 2011
@@ -856,6 +856,10 @@
 		hook->callback(bridge, bridge_channel, hook->hook_pvt);
 	} else {
 		ast_bridge_dtmf_stream(bridge, dtmf, bridge_channel->chan);
+	}
+
+	/* if the channel is still in feature state, revert it back to wait state */
+	if (bridge_channel->state == AST_BRIDGE_CHANNEL_STATE_FEATURE) {
 		ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_WAIT);
 	}
 




More information about the asterisk-commits mailing list