pbx/pbx_spool: Fix issue when call files were executed too early
authorIvan Poddubny <ivan.poddubny@gmail.com>
Mon, 11 May 2015 12:07:31 +0000 (12:07 +0000)
committerIvan Poddubny <ivan.poddubny@gmail.com>
Mon, 11 May 2015 20:34:11 +0000 (20:34 +0000)
commite6ebddd9ae22949eded1c58fcca00ba615ca9428
tree75f80cdf75f5373d582b5fe4e884fba5710319e8
parent4da293459297ed66fbb85aa53e328bd560e73d17
pbx/pbx_spool: Fix issue when call files were executed too early

pbx_spool used to delete/move the call file upon successful outgoing
call completion, but did not delete it from in-memory list of files
(dirlist, used only when compiled with inotify/kqueue support).
That resulted in an extra attempt to process that filename after
retrytime seconds.
Then, if a new file with the same name appears that is scheduled
in future further than the completed one plus its retrytime,
then it gets executed earlier than expected.

This patch fixes remove_from_queue function to also remove the entry
from the dirlist.

ASTERISK-17069 #close
Reported by: Jeremy Kister

ASTERISK-24442 #close
Reported by: tootai

Change-Id: If9ec9b88073661ce485d6b008fd0b2612e49a28b
pbx/pbx_spool.c