app_confbridge: Race between removing and playing name recording while leaving
authorRobert Mordec <r.mordec@slican.pl>
Tue, 23 May 2017 10:45:29 +0000 (12:45 +0200)
committerRobert Mordec <r.mordec@slican.pl>
Tue, 23 May 2017 12:20:01 +0000 (07:20 -0500)
commit36e90952ec6a6ee85926bf43a235c48940957ddc
tree0be6265563150b4d86dd40b8b3ff39167d71d9f5
parent95c6b98acf16f487fcc930bef7450ece1025ec20
app_confbridge: Race between removing and playing name recording while leaving

When user leaves a conference, its channel calls async_play_sound_file()
in order to play the name announcement and then unlinks the sound file.
The async_play_sound_file() function adds a task to conference playback queue,
which then runs playback_common() function in a different thread.

It leads to a race condition when, in some cases, channel thread may unlink
the sound file before playback_common() had a chance to open it.

This patch creates a file deletion task, that is queued after playback.

ASTERISK-27012 #close

Change-Id: I412f7922d412004b80917d4e892546c15bd70dd3
apps/app_confbridge.c