[asterisk-commits] file: trunk r354939 - in /trunk: ./ apps/app_confbridge.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 13 10:42:44 CST 2012


Author: file
Date: Mon Feb 13 10:42:42 2012
New Revision: 354939

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=354939
Log:
Don't try to play sound files that do not exist.

(closes issue ASTERISK-19188)
Reported by: slesru
........

Merged revisions 354938 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/apps/app_confbridge.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=354939&r1=354938&r2=354939
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Mon Feb 13 10:42:42 2012
@@ -614,7 +614,7 @@
 				"")) {
 				return -1;
 			}
-		} else {
+		} else if (ast_fileexists(there_are, NULL, NULL) && ast_fileexists(other_in_party, NULL, NULL)) {
 			play_sound_file(conference_bridge, there_are);
 			play_sound_number(conference_bridge, conference_bridge->users - 1);
 			play_sound_file(conference_bridge, other_in_party);
@@ -1146,6 +1146,12 @@
 static int play_sound_helper(struct conference_bridge *conference_bridge, const char *filename, int say_number)
 {
 	struct ast_channel *underlying_channel;
+
+	/* Do not waste resources trying to play files that do not exist */
+	if (!ast_fileexists(filename, NULL, NULL)) {
+		ast_log(LOG_WARNING, "File %s does not exist in any format\n", filename);
+		return 0;
+	}
 
 	ast_mutex_lock(&conference_bridge->playback_lock);
 	if (!(conference_bridge->playback_chan)) {




More information about the asterisk-commits mailing list