[Asterisk-code-review] app queue.c: Fix clearing of pause reason string. (asterisk[14])

Richard Mudgett asteriskteam at digium.com
Thu Oct 13 15:56:20 CDT 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/4087

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/87/4087/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index 873ab0c..d41ddb1 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -7233,12 +7233,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/4087
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I993dad19626ec017478a230e980989438b778c53
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list