[asterisk-commits] file: branch file/bridging r106894 - /team/file/bridging/apps/app_confbridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 7 16:41:11 CST 2008


Author: file
Date: Fri Mar  7 16:41:11 2008
New Revision: 106894

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106894
Log:
Add a basic user menu. Right now it is only capable of muting/unmuting.

Modified:
    team/file/bridging/apps/app_confbridge.c

Modified: team/file/bridging/apps/app_confbridge.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/apps/app_confbridge.c?view=diff&rev=106894&r1=106893&r2=106894
==============================================================================
--- team/file/bridging/apps/app_confbridge.c (original)
+++ team/file/bridging/apps/app_confbridge.c Fri Mar  7 16:41:11 2008
@@ -190,7 +190,27 @@
  */
 static int menu_callback_user(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
 {
-	return 0;
+	int digit, res = 0;
+
+	/* Try to play back the user menu, if it fails pass this back up so the bridging core will act on it */
+	if (ast_streamfile(bridge_channel->chan, "conf-usermenu", bridge_channel->chan->language)) {
+		return -1;
+	}
+
+	/* Wait for them to enter a digit from the user menu options */
+	digit = ast_waitstream(bridge_channel->chan, AST_DIGIT_ANY);
+	ast_stopstream(bridge_channel->chan);
+
+	if (digit == '1') {
+		/* 1 - Mute or unmute yourself */
+		bridge_channel->muted = (!bridge_channel->muted ? 1 : 0);
+		if (!(res = ast_streamfile(bridge_channel->chan, (bridge_channel->muted ? "conf-muted" : "conf-unmuted"), bridge_channel->chan->language)))
+			ast_waitstream(bridge_channel->chan, "");
+	}
+
+	bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_WAIT;
+
+	return res;
 }
 
 /*!




More information about the asterisk-commits mailing list