summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2009-04-08 15:27:41 +0000
committerMark Michelson <mmichelson@digium.com>2009-04-08 15:27:41 +0000
commit5d645640e62cef53de5ee5d3be3bb4d5c3a4376b (patch)
treed8550e4459423a53648cf96961269cc5fa8f324a /main
parent791b82b83624bbebe690267aee9bb69ca2d76675 (diff)
Merged revisions 186984 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r186984 | mmichelson | 2009-04-08 10:26:46 -0500 (Wed, 08 Apr 2009) | 24 lines Make a couple of changes with regards to a new message printed in ast_read(). "ast_read() called with no recorded file descriptor" is a new message added after a bug was discovered. Unfortunately, it seems there are a bunch of places that potentially make such calls to ast_read() and trigger this error message to be displayed. This commit does two things to help to make this message appear less. First, the message has been downgraded to a debug level message if dev mode is not enabled. The message means a lot more to developers than it does to end users, and so developers should take an effort to be sure to call ast_read only when a channel is ready to be read from. However, since this doesn't actually cause an error in operation and is not something a user can easily fix, we should not spam their console with these messages. Second, the message has been moved to after the check for any pending masquerades. ast_read() being called with no recorded file descriptor should not interfere with a masquerade taking place. This could be seen as a simple way of resolving issue #14723. However, I still want to try to clear out the existing ways of triggering this message, since I feel that would be a better resolution for the issue. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/channel.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/main/channel.c b/main/channel.c
index 9da0c5993..4fa5ae7ea 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2823,12 +2823,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
usleep(1);
}
- if (chan->fdno == -1) {
- ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n");
- f = &ast_null_frame;
- goto done;
- }
-
if (chan->masq) {
if (ast_do_masquerade(chan))
ast_log(LOG_WARNING, "Failed to perform masquerade\n");
@@ -2837,6 +2831,16 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
goto done;
}
+ if (chan->fdno == -1) {
+#ifdef AST_DEVMODE
+ ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n");
+#else
+ ast_debug(2, "ast_read() called with no recorded file descriptor.\n");
+#endif
+ f = &ast_null_frame;
+ goto done;
+ }
+
/* Stop if we're a zombie or need a soft hangup */
if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
if (chan->generator)