app_record: Don't set RECORD_STATUS chan var until file is closed
authorGeorge Joseph <gjoseph@digium.com>
Wed, 15 Nov 2017 18:10:16 +0000 (11:10 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 15 Nov 2017 20:03:21 +0000 (15:03 -0500)
commitf51270736248d703c8b53eff3e4de97e837eb5a1
tree426ba767f9921f8526d1bbca03cdfdd206740356
parentaa65be95c08915819b542462b04216981dc69d1a
app_record:  Don't set RECORD_STATUS chan var until file is closed

We've been calling pbx_builtin_setvar_helper to set the
RECORD_STATUS variable before actually closing the recorded file.
If a client is watching VarSet events and tries to do something with
the file when a RECORD_STATUS event is seen, they might attempt to
do so while the file it's still open.

We now delay calling pbx_builtin_setvar_helper until after we close
the file.

ASTERISK-27423

Change-Id: I7fe9de99953e46b4bafa2b38cf151fe8f6488254
apps/app_record.c