[asterisk-commits] branch oej/test-this-branch r13388 - in /team/oej/test-this-branch: ./ apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Mar 18 02:58:27 MST 2006


Author: oej
Date: Sat Mar 18 03:58:24 2006
New Revision: 13388

URL: http://svn.digium.com/view/asterisk?rev=13388&view=rev
Log:
Fix race in voicemail (corydon76, #6714)

Modified:
    team/oej/test-this-branch/README.test-this-branch
    team/oej/test-this-branch/apps/app_voicemail.c

Modified: team/oej/test-this-branch/README.test-this-branch
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/README.test-this-branch?rev=13388&r1=13387&r2=13388&view=diff
==============================================================================
--- team/oej/test-this-branch/README.test-this-branch (original)
+++ team/oej/test-this-branch/README.test-this-branch Sat Mar 18 03:58:24 2006
@@ -33,7 +33,7 @@
 - metermaids: Subscription support for parking lots (#5779)
 - filenamelen: Some code changes for file name lengths (oej)
 - disable-ol-and-sub: Settings for disabling sip subscriptions and overlap 
-  dialing (#6705, oej)
+  dialing (#6705, oej) - See configs/sip.conf.sample
 - t38passthrough: Support for Fax passthrough in SIP (#5090, Steve Underwood)
 
 And the following stand-alone patches
@@ -52,11 +52,11 @@
 - Manager playDTMF command (squinky, #6682) 
   (Note: I changed the name in this version...)
 - G.722 support in Asterisk (passthrough, formats) (andrew, #5084)
+- Fix race condition in voicemail (corydon76, #6714)
 
 Things that has been commited to svn trunk:
 - Abandon Queue manager event (tim_ringenbach, #6459)
 - End CDR before 'h' extension (russellb, #6193)
-
 
 Coming here soon:
 - siptransfer: Improved SIP transfer support (branch)
@@ -65,6 +65,9 @@
 in each open issue report, so that we get the feedback for each
 patch. Your opinion, good or bad, is important for us.
 http://bugs.digium.com
+
+The time you use to test this branch is a very important donation
+to the Asterisk Open Source project. Thank you!
 
 * Open BUGS (fixes welcome!)
 ----------------------------

Modified: team/oej/test-this-branch/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_voicemail.c?rev=13388&r1=13387&r2=13388&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_voicemail.c (original)
+++ team/oej/test-this-branch/apps/app_voicemail.c Sat Mar 18 03:58:24 2006
@@ -2374,6 +2374,7 @@
 static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
 {
 	char txtfile[AST_MAX_FILENAME_LEN];
+	char tmptxtfile[AST_MAX_FILENAME_LEN];
 	char callerid[256];
 	FILE *txt;
 	int res = 0;
@@ -2572,7 +2573,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, 
@@ -2612,6 +2614,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