[Asterisk-code-review] Unpausing of wrap-up should grant grace time. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Wed May 18 05:14:30 CDT 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/2865

Change subject: Unpausing of wrap-up should grant grace time.
......................................................................

Unpausing of wrap-up should grant grace time.

If an agent unpauses from wrap-up, they should get
Asterisk's internal wrap-up grace time to allow them to
pause again, for another reason.

For example, if an agent finishes their wrap-up after
a call, and then if they need to go on break, this
would allow them to re-pause for break without having
a new call instantly come in when they unpause from
wrap-up.

ASTERISK-26032

Change-Id: If1119dd490c17429741d6974550da34d266c066f
---
M apps/app_queue.c
1 file changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/2865/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index dbd8393..5e292bb 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1358,6 +1358,8 @@
 
 static char *app_ql = "QueueLog" ;
 
+static char *wrap_up = "wrap-up";
+
 /*! \brief Persistent Members astdb family */
 static const char * const pm_family = "Queue/PersistentMembers";
 
@@ -6166,6 +6168,16 @@
 			queue_data->holdstart, queue_data->starttime, reason);
 	update_queue(queue_data->queue, queue_data->member, queue_data->callcompletedinsl,
 			time(NULL) - queue_data->starttime);
+
+	/* pause all of the agent's queues after a complete */
+	if (queue_data->queue->pause_wrapup_after_complete) {
+		if (!set_member_paused( (char *) NULL, queue_data->member->interface, wrap_up, 1)) {
+			ast_verb(3, "Paused %s for after-call %s after call complete.\n", queue_data->member->interface, wrap_up);
+		} else {
+			ast_verb(3, "Failed to pause %s for after-call %s after call complete.\n", queue_data->member->interface, wrap_up);
+		}
+	}
+
 	remove_stasis_subscriptions(queue_data);
 }
 
@@ -7172,6 +7184,18 @@
 			ast_copy_string(mem->reason_paused, reason, sizeof(mem->reason_paused));
 		}
 	} else {
+		ast_debug(1, "%s was paused for %s.\n", mem->interface, mem->reason_paused);
+
+		/* if we're using pause_wrapup_after_complete, we want to
+		 * reset lastcall after a wrap-up pause to give a grace 
+		 * period from wrapup after un-pausing for wrap-up.
+		 * e.g., done with wrap-up pause, going on break now.
+		 */
+		if (q->pause_wrapup_after_complete && !strcmp(mem->reason_paused, wrap_up)) {
+			ast_debug(1, "resetting lastcall for %s because they were paused for %s.\n", mem->interface, mem->reason_paused);
+			mem->lastcall = time(NULL);
+		}
+
 		ast_copy_string(mem->reason_paused, "", sizeof(mem->reason_paused));
 	}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1119dd490c17429741d6974550da34d266c066f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Troy Bowman <troy at lump.net>



More information about the asterisk-code-review mailing list