diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-19 17:25:52 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-19 17:25:52 +0000 |
commit | d7bcf1c25c698c8639dd3d8cf0955186d733172f (patch) | |
tree | 2e3db98c8b96861590b1651f746512270801eb59 /pbx | |
parent | b6a61a7d6b46d8da70a737f3a2e45adbd281756a (diff) |
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)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28705 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_spool.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index 132508a65..855001c15 100644 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -254,6 +254,7 @@ static void *attempt_thread(void *data) { 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 @@ static void *attempt_thread(void *data) } 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, ¤t_file_status)) { + if (time(NULL) >= current_file_status.st_atime) + unlink(o->fn); + } } free_outgoing(o); return NULL; |