aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_agi.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-10 21:17:13 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-10 21:17:13 +0000
commitc71eea9cdd746a9c4e2bb898a4f0e585270dfd27 (patch)
treebb567c095d58785195177f50cb157f23dbeabd10 /apps/app_agi.c
parenteca59c8df0f74926c4b833134fb45f7fcdca729e (diff)
Free dsp in agi record file if it exits before the end (bug 1199)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2391 f38db490-d61c-443f-a65b-d21fe96a405b
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;