]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Free dsp in agi record file if it exits before the end (bug 1199)
authorJames Golovich <james@gnuinter.net>
Wed, 10 Mar 2004 21:17:13 +0000 (21:17 +0000)
committerJames Golovich <james@gnuinter.net>
Wed, 10 Mar 2004 21:17:13 +0000 (21:17 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2391 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_agi.c

index c30fd5be23272bf0f54f296a0173b382e79a1da9..9e083f23183a5b425285e9b98bd21db13de626ac 100755 (executable)
@@ -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;