aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-04 17:12:47 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-04 17:12:47 +0000
commit787c56eb3ef01d79701714a6d41af70526d33856 (patch)
tree2cc68184651fc954b824b325b658d1a5034f9822
parent31b9dddcd8784878af3306eb83212ecaf8cbcbde (diff)
Only do frame payload check for HOLD frames.
This code was added for helping to debug the source of invalid HOLD frames. However, a side effect of this is that it will incorrectly report errors for frames that have an integer payload. Make the check for this block specific to the HOLD frame case. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@233092 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/channel.c b/main/channel.c
index bfbe49f6f..75d4f72db 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2513,15 +2513,15 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
ast_frame_dump(chan->name, f, "<<");
chan->fin = FRAMECOUNT_INC(chan->fin);
- if (f && f->datalen == 0 && f->data) {
+ if (f && f->frametype == AST_FRAME_CONTROL && f->subclass == AST_CONTROL_HOLD && f->datalen == 0 && f->data) {
/* fix invalid pointer */
f->data = NULL;
#ifdef AST_DEVMODE
- ast_log(LOG_ERROR, "Found frame with src '%s' on channel '%s' with datalen zero, but non-null data pointer!\n", f->src, chan->name);
+ ast_log(LOG_ERROR, "Found HOLD frame with src '%s' on channel '%s' with datalen zero, but non-null data pointer!\n", f->src, chan->name);
ast_frame_dump(chan->name, f, "<<");
#else
if (option_debug > 2) {
- ast_log(LOG_DEBUG, "Found frame with src '%s' on channel '%s' with datalen zero, but non-null data pointer!\n", f->src, chan->name);
+ ast_log(LOG_DEBUG, "Found HOLD frame with src '%s' on channel '%s' with datalen zero, but non-null data pointer!\n", f->src, chan->name);
}
#endif
}