[asterisk-commits] trunk r13749 - in /trunk: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Mar 20 23:28:20 MST 2006


Author: tilghman
Date: Tue Mar 21 00:28:19 2006
New Revision: 13749

URL: http://svn.digium.com/view/asterisk?rev=13749&view=rev
Log:
Merged revisions 13748 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r13748 | tilghman | 2006-03-21 00:24:56 -0600 (Tue, 21 Mar 2006) | 2 lines

Bug 6714 - Workaround to avoid retrieving incomplete voicemail message

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=13749&r1=13748&r2=13749&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Tue Mar 21 00:28:19 2006
@@ -2364,7 +2364,7 @@
 
 static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
 {
-	char txtfile[256];
+	char tmptxtfile[256], txtfile[256];
 	char callerid[256];
 	FILE *txt;
 	int res = 0;
@@ -2561,7 +2561,8 @@
 				
 			/* Store information */
 			snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
-			txt = fopen(txtfile, "w+");
+			snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn);
+			txt = fopen(tmptxtfile, "w+");
 			if (txt) {
 				get_date(date, sizeof(date));
 				fprintf(txt, 
@@ -2601,6 +2602,7 @@
 			if (txt) {
 				fprintf(txt, "duration=%d\n", duration);
 				fclose(txt);
+				rename(tmptxtfile, txtfile);
 			}
 				
 			if (duration < vmminmessage) {



More information about the asterisk-commits mailing list