]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_playback: Suppress warnings on playback if channel hung up 00/500/1
authorGeorge Joseph <george.joseph@fairview5.com>
Thu, 21 May 2015 00:05:20 +0000 (18:05 -0600)
committerGeorge Joseph <george.joseph@fairview5.com>
Thu, 21 May 2015 00:05:20 +0000 (18:05 -0600)
If a channel hangs up while an audio file is playing, there's
no need to clutter up the logs with a warning so suppress it
if ast_check_hangup returns true.

Also, change warning to debug/2 in file.c if writing a frame
fails.  Same reasoning.

Change-Id: I2e66191af3c5b6e951c98e8f1c3fe3cf2cf7ed89
Reported-by: George Joseph <george.joseph@fairview5.com>
Tested-by: George Joseph <george.joseph@fairview5.com>
apps/app_playback.c
main/file.c

index 6787573192a2aeb4d95539e2474eafce16029dba..e5df79445a01c25671fba2a2004d3f74e5d77909 100644 (file)
@@ -490,7 +490,9 @@ static int playback_exec(struct ast_channel *chan, const char *data)
                                ast_stopstream(chan);
                        }
                        if (res) {
-                               ast_log(LOG_WARNING, "Playback failed on %s for %s\n", ast_channel_name(chan), (char *)data);
+                               if (!ast_check_hangup(chan)) {
+                                       ast_log(LOG_WARNING, "Playback failed on %s for %s\n", ast_channel_name(chan), (char *)data);
+                               }
                                res = 0;
                                mres = 1;
                        }
index b0d5011cf95dc168f5d5619eeaa1adb635e5e04c..64406bf85548f5040b7f047e8a0bb8ccd5d39fc8 100644 (file)
@@ -902,7 +902,7 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s)
 
                if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
                        if (fr) {
-                               ast_log(LOG_WARNING, "Failed to write frame\n");
+                               ast_debug(2, "Failed to write frame\n");
                                ast_frfree(fr);
                        }
                        goto return_failure;
@@ -959,7 +959,7 @@ static enum fsread_res ast_readvideo_callback(struct ast_filestream *s)
 
                if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
                        if (fr) {
-                               ast_log(LOG_WARNING, "Failed to write frame\n");
+                               ast_debug(2, "Failed to write frame\n");
                                ast_frfree(fr);
                        }
                        ast_channel_vstreamid_set(s->owner, -1);