[asterisk-commits] trunk r28705 - /trunk/pbx/pbx_spool.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 19 10:25:52 MST 2006


Author: russell
Date: Fri May 19 12:25:52 2006
New Revision: 28705

URL: http://svn.digium.com/view/asterisk?rev=28705&view=rev
Log:
only delete call files if the timestamp on the file is not in the future, so
that a call file can be reused (issue #6750, patch by moy, committed patch is
slightly simplified)

Modified:
    trunk/pbx/pbx_spool.c

Modified: trunk/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_spool.c?rev=28705&r1=28704&r2=28705&view=diff
==============================================================================
--- trunk/pbx/pbx_spool.c (original)
+++ trunk/pbx/pbx_spool.c Fri May 19 12:25:52 2006
@@ -254,6 +254,7 @@
 {
 	struct outgoing *o = data;
 	int res, reason;
+	struct stat current_file_status;
 	if (!ast_strlen_zero(o->app)) {
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
@@ -276,7 +277,10 @@
 	} else {
 		ast_log(LOG_NOTICE, "Call completed to %s/%s\n", o->tech, o->dest);
 		ast_log(LOG_EVENT, "Queued call to %s/%s completed\n", o->tech, o->dest);
-		unlink(o->fn);
+		if (!stat(o->fn, &current_file_status)) {
+			if (time(NULL) >= current_file_status.st_atime)
+				unlink(o->fn);
+		}
 	}
 	free_outgoing(o);
 	return NULL;



More information about the asterisk-commits mailing list