Avoid a crash in the handling of DTMF based Caller ID. It is valid for

ast_read to return NULL in the case that the channel has been hung up.
(crash reported by anonymouz666 on IRC in #asterisk-dev)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Russell Bryant 18 years ago
parent 403ee9194c
commit 467ceebc82

@ -6111,6 +6111,8 @@ static void *ss_thread(void *data)
return NULL; return NULL;
} }
f = ast_read(chan); f = ast_read(chan);
if (!f)
break;
if (f->frametype == AST_FRAME_DTMF) { if (f->frametype == AST_FRAME_DTMF) {
dtmfbuf[i++] = f->subclass; dtmfbuf[i++] = f->subclass;
ast_log(LOG_DEBUG, "CID got digit '%c'\n", f->subclass); ast_log(LOG_DEBUG, "CID got digit '%c'\n", f->subclass);

Loading…
Cancel
Save