diff options
author | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-03-10 21:17:13 +0000 |
---|---|---|
committer | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-03-10 21:17:13 +0000 |
commit | c71eea9cdd746a9c4e2bb898a4f0e585270dfd27 (patch) | |
tree | bb567c095d58785195177f50cb157f23dbeabd10 | |
parent | eca59c8df0f74926c4b833134fb45f7fcdca729e (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
-rwxr-xr-x | apps/app_agi.c | 8 |
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; |