[asterisk-commits] file: trunk r175549 - /trunk/apps/app_record.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 13 10:41:15 CST 2009


Author: file
Date: Fri Feb 13 10:41:15 2009
New Revision: 175549

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=175549
Log:
Add an option to keep the recorded file upon hangup.
(closes issue #14341)
Reported by: fnordian

Modified:
    trunk/apps/app_record.c

Modified: trunk/apps/app_record.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/apps/app_record.c?view=diff&rev=175549&r1=175548&r2=175549
==============================================================================
--- trunk/apps/app_record.c (original)
+++ trunk/apps/app_record.c Fri Feb 13 10:41:15 2009
@@ -75,6 +75,9 @@
 					<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 @@
 	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 @@
 		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) {




More information about the asterisk-commits mailing list