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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 10 21:14:31 CDT 2008


Author: file
Date: Mon Mar 10 21:14:31 2008
New Revision: 107349

URL: http://svn.digium.com/view/asterisk?view=rev&rev=107349
Log:
Make the join/leave sounds configurable usable dialplan variables.

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=107349&r1=107348&r2=107349
==============================================================================
--- team/file/bridging/apps/app_confbridge.c (original)
+++ team/file/bridging/apps/app_confbridge.c Mon Mar 10 21:14:31 2008
@@ -393,7 +393,7 @@
 }
 
 /*! \brief The ConfBridge application */
-static int app_exec(struct ast_channel *chan, void *data)
+static int confbridge_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
 	char *parse;
@@ -401,6 +401,8 @@
 	struct conference_bridge_user conference_bridge_user = {
 		.chan = chan,
 	};
+	const char *join_sound = pbx_builtin_getvar_helper(chan, "CONFBRIDGE_JOIN_SOUND");
+	const char *leave_sound = pbx_builtin_getvar_helper(chan, "CONFBRIDGE_LEAVE_SOUND");
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(conf_name);
 		AST_APP_ARG(options);
@@ -439,9 +441,9 @@
 	}
 
 	/* If there is 1 or more people already in the conference then play our join sound unless overridden */
-	if (conference_bridge->users >= 2) {
+	if (!ast_strlen_zero(join_sound) && conference_bridge->users >= 2) {
 		ast_autoservice_start(chan);
-		play_sound_file(conference_bridge, "beep");
+		play_sound_file(conference_bridge, join_sound);
 		ast_autoservice_stop(chan);
 	}
 
@@ -449,9 +451,9 @@
 	ast_bridge_join(conference_bridge->bridge, chan, NULL, &conference_bridge_user.features);
 
 	/* If there is 1 or more people (not including us) already in the conference then play our leave sound unless overridden */
-	if (conference_bridge->users >= 2) {
+	if (!ast_strlen_zero(leave_sound) && conference_bridge->users >= 2) {
 		ast_autoservice_start(chan);
-		play_sound_file(conference_bridge, "beep");
+		play_sound_file(conference_bridge, leave_sound);
 		ast_autoservice_stop(chan);
 	}
 
@@ -478,7 +480,7 @@
 /*! \brief Called when module is being loaded */
 static int load_module(void)
 {
-	if (ast_register_application(app, app_exec, synopsis, descrip))
+	if (ast_register_application(app, confbridge_exec, synopsis, descrip))
 		return AST_MODULE_LOAD_DECLINE;
 
 	return AST_MODULE_LOAD_SUCCESS;




More information about the asterisk-commits mailing list