summaryrefslogtreecommitdiff
path: root/apps/app_agi.c
diff options
context:
space:
mode:
authorJames Golovich <james@gnuinter.net>2004-03-10 21:17:13 +0000
committerJames Golovich <james@gnuinter.net>2004-03-10 21:17:13 +0000
commitc0ef6a5d1bf40132a542d82d98323be6daa9a657 (patch)
treebb567c095d58785195177f50cb157f23dbeabd10 /apps/app_agi.c
parent18b3da6bab8af38257d8248cc7f27f2165b06bea (diff)
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
Diffstat (limited to 'apps/app_agi.c')
-rwxr-xr-xapps/app_agi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/app_agi.c b/apps/app_agi.c
index c30fd5be2..9e083f231 100755
--- a/apps/app_agi.c
+++ b/apps/app_agi.c
@@ -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;