[asterisk-commits] file: branch 10 r354938 - /branches/10/apps/app_confbridge.c

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


Author: file
Date: Mon Feb 13 10:41:56 2012
New Revision: 354938

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

(closes issue ASTERISK-19188)
Reported by: slesru

Modified:
    branches/10/apps/app_confbridge.c

Modified: branches/10/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_confbridge.c?view=diff&rev=354938&r1=354937&r2=354938
==============================================================================
--- branches/10/apps/app_confbridge.c (original)
+++ branches/10/apps/app_confbridge.c Mon Feb 13 10:41:56 2012
@@ -610,7 +610,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);
@@ -1142,6 +1142,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