diff options
author | Sergej Kasumovic <sergej@bicomsystems.com> | 2017-07-14 08:25:36 +0200 |
---|---|---|
committer | Sergej Kasumovic <sergej@bicomsystems.com> | 2017-07-14 14:43:33 +0200 |
commit | 3858d99b735dd45239984d6ff8eedaaa2beb45f6 (patch) | |
tree | 098cefda3817582861af888c88bfdb0ce3ae8429 | |
parent | ec182b6d509fe8ef965ac0c11147db33f53e6ca9 (diff) |
app_confbridge: Make sure name recordings are always removed from the filesystem
This commit fixes two possible scenarios:
* When recording name and if during recording you hangup, file is never
removed. This is due to the fact file location is nulled.
* When recording name and if you hangup during thank-you prompt, file
is never removed.
ASTERISK-27123 #close
Change-Id: I39b7271408b4b54ce880c5111a886aa8f28c2625
-rw-r--r-- | apps/app_confbridge.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c index c06466018..f95aaaf56 100644 --- a/apps/app_confbridge.c +++ b/apps/app_confbridge.c @@ -2137,6 +2137,7 @@ static int conf_rec_name(struct confbridge_user *user, const char *conf_name) } if (res == -1) { + ast_filedelete(user->name_rec_location, NULL); user->name_rec_location[0] = '\0'; return -1; } @@ -2228,6 +2229,7 @@ static int confbridge_exec(struct ast_channel *chan, const char *data) { int res = 0, volume_adjustments[2]; int quiet = 0; + int async_delete_task_pushed = 0; char *parse; const char *b_profile_name = NULL; const char *u_profile_name = NULL; @@ -2473,6 +2475,7 @@ static int confbridge_exec(struct ast_channel *chan, const char *data) async_play_sound_file(conference, conf_get_sound(CONF_SOUND_HAS_LEFT, conference->b_profile.sounds), NULL); async_delete_name_rec(conference, user.name_rec_location); + async_delete_task_pushed = 1; } /* play the leave sound */ @@ -2501,6 +2504,9 @@ static int confbridge_exec(struct ast_channel *chan, const char *data) } confbridge_cleanup: + if (!async_delete_task_pushed && !ast_strlen_zero(user.name_rec_location)) { + ast_filedelete(user.name_rec_location, NULL); + } ast_bridge_features_cleanup(&user.features); conf_bridge_profile_destroy(&user.b_profile); return res; |