[asterisk-commits] app queue.c: Fix clearing of pause reason string. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 14 10:08:23 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: app_queue.c: Fix clearing of pause reason string.
......................................................................


app_queue.c: Fix clearing of pause reason string.

The pause reason is not always cleared when it should be cleared.

* Made set_queue_member_pause() always clear pause reason if not pausing
with a reason string.

Change-Id: I993dad19626ec017478a230e980989438b778c53
---
M apps/app_queue.c
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/apps/app_queue.c b/apps/app_queue.c
index a023b88..34c0131 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -7232,12 +7232,12 @@
 
 	mem->paused = paused;
 	if (paused) {
-		if (!ast_strlen_zero(reason)) {
-			ast_copy_string(mem->reason_paused, reason, sizeof(mem->reason_paused));
-		}
 		time(&mem->lastpause); /* update last pause field */
+	}
+	if (paused && !ast_strlen_zero(reason)) {
+		ast_copy_string(mem->reason_paused, reason, sizeof(mem->reason_paused));
 	} else {
-		ast_copy_string(mem->reason_paused, "", sizeof(mem->reason_paused));
+		mem->reason_paused[0] = '\0';
 	}
 
 	ast_devstate_changed(mem->paused ? QUEUE_PAUSED_DEVSTATE : QUEUE_UNPAUSED_DEVSTATE,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I993dad19626ec017478a230e980989438b778c53
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list