aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_record.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-13 16:41:15 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-13 16:41:15 +0000
commite37f473463944c829757862922b534429856285a (patch)
tree3144a1ca07bf6d8d3249f9a8220a0c7a43490fbe /apps/app_record.c
parent9481e208c2184b59fc75aeb6d2cd37a56f409ca4 (diff)
Add an option to keep the recorded file upon hangup.
(closes issue #14341) Reported by: fnordian git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175549 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_record.c')
-rw-r--r--apps/app_record.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/app_record.c b/apps/app_record.c
index 8713563f0..69bbd5387 100644
--- a/apps/app_record.c
+++ b/apps/app_record.c
@@ -75,6 +75,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<option name="x">
<para>Ignore all terminator keys (DTMF) and keep recording until hangup.</para>
</option>
+ <option name="k">
+ <para>Keep recording if channel hangs up.</para>
+ </option>
</optionlist>
</parameter>
</syntax>
@@ -112,11 +115,13 @@ enum {
OPTION_SKIP = (1 << 3),
OPTION_STAR_TERMINATE = (1 << 4),
OPTION_IGNORE_TERMINATE = (1 << 5),
- FLAG_HAS_PERCENT = (1 << 6),
+ OPTION_KEEP = (1 << 6),
+ FLAG_HAS_PERCENT = (1 << 7),
};
AST_APP_OPTIONS(app_opts,{
AST_APP_OPTION('a', OPTION_APPEND),
+ AST_APP_OPTION('k', OPTION_KEEP),
AST_APP_OPTION('n', OPTION_NOANSWER),
AST_APP_OPTION('q', OPTION_QUIET),
AST_APP_OPTION('s', OPTION_SKIP),
@@ -378,7 +383,9 @@ static int record_exec(struct ast_channel *chan, void *data)
ast_debug(1, "Got hangup\n");
res = -1;
pbx_builtin_setvar_helper(chan, "RECORD_STATUS", "HANGUP");
- ast_filedelete(args.filename, NULL);
+ if (!ast_test_flag(&flags, OPTION_KEEP)) {
+ ast_filedelete(args.filename, NULL);
+ }
}
if (gotsilence) {