[asterisk-commits] app confbridge: Make sure name recordings are always removed... (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 17 09:35:09 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6022 )

Change subject: app_confbridge: Make sure name recordings are always removed from the filesystem
......................................................................

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
---
M apps/app_confbridge.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 0f846b6..c6372fa 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -2145,6 +2145,7 @@
 	}
 
 	if (res == -1) {
+		ast_filedelete(user->name_rec_location, NULL);
 		user->name_rec_location[0] = '\0';
 		return -1;
 	}
@@ -2236,6 +2237,7 @@
 {
 	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;
@@ -2481,6 +2483,7 @@
 		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 */
@@ -2509,6 +2512,9 @@
 	}
 
 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;

-- 
To view, visit https://gerrit.asterisk.org/6022
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I39b7271408b4b54ce880c5111a886aa8f28c2625
Gerrit-Change-Number: 6022
Gerrit-PatchSet: 2
Gerrit-Owner: Sergej Kasumovic <sergej at bicomsystems.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170717/d097f681/attachment-0001.html>


More information about the asterisk-commits mailing list