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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 28 15:45:21 CDT 2011


Author: dvossel
Date: Mon Mar 28 15:45:17 2011
New Revision: 311748

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311748
Log:
ConfBridge playback actions can now accept multiple files as arguments separated by the '&' delimiter

Thanks for the idea jparker (qwell)!

Modified:
    team/dvossel/hd_confbridge/apps/app_confbridge.c
    team/dvossel/hd_confbridge/configs/confbridge.conf.sample

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=311748&r1=311747&r2=311748
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Mon Mar 28 15:45:17 2011
@@ -1362,9 +1362,14 @@
 
 static int action_playback(struct ast_bridge_channel *bridge_channel, const char *playback_file)
 {
-	if (ast_stream_and_wait(bridge_channel->chan, playback_file, "")) {
-		ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", playback_file);
-		return -1;
+	char *file_copy = ast_strdupa(playback_file);
+	char *file = NULL;
+
+	while ((file = strsep(&file_copy, "&"))) {
+		if (ast_stream_and_wait(bridge_channel->chan, file, "")) {
+			ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", file);
+			return -1;
+		}
 	}
 	return 0;
 }
@@ -1378,21 +1383,31 @@
 	int *stop_prompts)
 {
 	int i;
-	int digit;
+	int digit = 0;
 	char dtmf[MAXIMUM_DTMF_FEATURE_STRING];
 	struct conf_menu_entry new_menu_entry = { { 0, }, };
-
-	if (ast_streamfile(bridge_channel->chan, playback_file, bridge_channel->chan->language)) {
-		ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", playback_file);
-		return -1;
-	}
-
-	/* now wait for more digits. */
-	if (!(digit = ast_waitstream(bridge_channel->chan, AST_DIGIT_ANY))) {
-		/* streaming finished and no DTMF was entered */
-		return -1;
-	} else if (digit == -1) {
-		/* error */
+	char *file_copy = ast_strdupa(playback_file);
+	char *file = NULL;
+
+	while ((file = strsep(&file_copy, "&"))) {
+		if (ast_streamfile(bridge_channel->chan, file, bridge_channel->chan->language)) {
+			ast_log(LOG_WARNING, "Failed to playback file %s to channel\n", file);
+			return -1;
+		}
+
+		/* now wait for more digits. */
+		if (!(digit = ast_waitstream(bridge_channel->chan, AST_DIGIT_ANY))) {
+			/* streaming finished and no DTMF was entered */
+			continue;
+		} else if (digit == -1) {
+			/* error */
+			return -1;
+		} else {
+			break; /* dtmf was entered */
+		}
+	}
+	if (!digit) {
+		/* streaming finished on all files and no DTMF was entered */
 		return -1;
 	}
 	ast_stopstream(bridge_channel->chan);

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=311748&r1=311747&r2=311748
==============================================================================
--- team/dvossel/hd_confbridge/configs/confbridge.conf.sample (original)
+++ team/dvossel/hd_confbridge/configs/confbridge.conf.sample Mon Mar 28 15:45:17 2011
@@ -207,20 +207,25 @@
 ; to a DTMF sequence.
 ;
 ; A single DTMF sequence can have multiple actions associated with it. This is
-; accomplished by stringing the actions together.
-: Example:  Two playback files are played back one after the other after '*' is pressed.
-; *=playback_and_continue(tt-weasels),playback_and_continue(tt-monkeys)
-;
-; playback(<name of playback prompt>)  ; Playback will play back a prompt to a channel
+; accomplished by stringing the actions together and using a ',' as the delimiter.
+: Example:  Both listening and talking volume is reset when '5' is pressed.
+; 5=reset_talking_volume, reset_listening_volume
+;
+; playback(<name of audio file>&<name of audio file>)
+                                       ; Playback will play back an audio file to a channel
                                        ; and then immediately return to the conference.
-                                       ; This prompt can not be interupted by DTMF.
-; playback_and_continue(<name of playback prompt>) ; playback_and_continue will
+                                       ; This file can not be interupted by DTMF.
+                                       ; Mutliple files can be chained together using the
+                                       ; '&' character.
+; playback_and_continue(<name of playback prompt>&<name of playback prompt>)
+                                       ; playback_and_continue will
                                        ; play back a prompt while continuing to
                                        ; collect the dtmf sequence.  This is useful
                                        ; when using a menu prompt that describes all
                                        ; the menu options.  Note however that any DTMF
                                        ; during this action will terminate the prompts
-                                       ; playback.
+                                       ; playback.  Prompt files can be chained together
+                                       ; using the '&' character as a delimiter.
 ; toggle_mute      ; Toggle turning on and off mute.  Mute will make the user silent
                    ; to everyone else, but the user will still be able to listen in.
                    ; continue to collect the dtmf sequence.




More information about the asterisk-commits mailing list