[asterisk-commits] file: branch 1.6.1 r175551 - in /branches/1.6.1: ./ apps/app_record.c

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


Author: file
Date: Fri Feb 13 10:44:37 2009
New Revision: 175551

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=175551
Log:
Merged revisions 175549 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r175549 | file | 2009-02-13 12:41:15 -0400 (Fri, 13 Feb 2009) | 4 lines
  
  Add an option to keep the recorded file upon hangup.
  (closes issue #14341)
  Reported by: fnordian
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/apps/app_record.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/apps/app_record.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.1/apps/app_record.c?view=diff&rev=175551&r1=175550&r2=175551
==============================================================================
--- branches/1.6.1/apps/app_record.c (original)
+++ branches/1.6.1/apps/app_record.c Fri Feb 13 10:44:37 2009
@@ -51,6 +51,7 @@
 "or 0 there is no maximum.\n"
 "- 'options' may contain any of the following letters:\n"
 "     'a' : append to existing recording rather than replacing\n"
+"     'k' : keep recorded file upon hangup\n"
 "     'n' : do not answer, but record anyway if line not yet answered\n"
 "     'q' : quiet (do not play a beep tone)\n"
 "     's' : skip recording if the line is not yet answered\n"
@@ -72,11 +73,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),
@@ -325,7 +328,9 @@
 	if (!f) {
 		ast_debug(1, "Got hangup\n");
 		res = -1;
-		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