mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 15:29:05 +00:00
Free dsp in agi record file if it exits before the end (bug 1199)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -550,6 +550,8 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
||||
if (!fs) {
|
||||
res = -1;
|
||||
fdprintf(agi->fd, "200 result=%d (writefile)\n", res);
|
||||
if (sildet)
|
||||
ast_dsp_free(sildet);
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -566,12 +568,16 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
||||
if (res < 0) {
|
||||
ast_closestream(fs);
|
||||
fdprintf(agi->fd, "200 result=%d (waitfor) endpos=%ld\n", res,sample_offset);
|
||||
if (sildet)
|
||||
ast_dsp_free(sildet);
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
f = ast_read(chan);
|
||||
if (!f) {
|
||||
fdprintf(agi->fd, "200 result=%d (hangup) endpos=%ld\n", 0, sample_offset);
|
||||
ast_closestream(fs);
|
||||
if (sildet)
|
||||
ast_dsp_free(sildet);
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
switch(f->frametype) {
|
||||
@@ -582,6 +588,8 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
||||
fdprintf(agi->fd, "200 result=%d (dtmf) endpos=%ld\n", f->subclass, sample_offset);
|
||||
ast_closestream(fs);
|
||||
ast_frfree(f);
|
||||
if (sildet)
|
||||
ast_dsp_free(sildet);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user