Skip to content
Snippets Groups Projects
Commit c0ef6a5d authored by James Golovich's avatar James Golovich
Browse files

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
parent 18b3da6b
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment