[asterisk-commits] eliel: branch eliel/per_member_wrapuptime r188735 - in /team/eliel/per_member...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 16 10:50:34 CDT 2009


Author: eliel
Date: Thu Apr 16 10:50:22 2009
New Revision: 188735

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=188735
Log:
Simplify the code.
Add documentation to manager_1_1 and CHANGES.

Modified:
    team/eliel/per_member_wrapuptime/CHANGES
    team/eliel/per_member_wrapuptime/apps/app_queue.c
    team/eliel/per_member_wrapuptime/doc/manager_1_1.txt

Modified: team/eliel/per_member_wrapuptime/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/eliel/per_member_wrapuptime/CHANGES?view=diff&rev=188735&r1=188734&r2=188735
==============================================================================
--- team/eliel/per_member_wrapuptime/CHANGES (original)
+++ team/eliel/per_member_wrapuptime/CHANGES Thu Apr 16 10:50:22 2009
@@ -401,6 +401,8 @@
 
 CLI Changes
 -----------
+  * New CLI command, "queue set wrapuptime" used to specify the wrapuptime for
+     a member of a queue.
   * New CLI command, "config reload <file.conf>" which reloads any module that
      references that particular configuration file.  Also added "config list"
      which shows which configuration files are in use.

Modified: team/eliel/per_member_wrapuptime/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/eliel/per_member_wrapuptime/apps/app_queue.c?view=diff&rev=188735&r1=188734&r2=188735
==============================================================================
--- team/eliel/per_member_wrapuptime/apps/app_queue.c (original)
+++ team/eliel/per_member_wrapuptime/apps/app_queue.c Thu Apr 16 10:50:22 2009
@@ -2424,10 +2424,10 @@
  *        decide if the wrapuptime has expired.
  * \param lastcall[in] The time the lastcall was received.
  * \param wrapuptime[in] The configured wrapuptime.
- * \retval 1 if the wrapuptime expired.
- * \retval 0 if the wrapuptime didn't expired.
+ * \retval 1 if the wrapuptime didn't expired.
+ * \retval 0 if the wrapuptime expired.
  */
-static int wrapuptime_expired(int lastcall, int wrapuptime)
+static int wrapuptime_notexpired(int lastcall, int wrapuptime)
 {
 	if (time(NULL) - lastcall < wrapuptime) {
 		return 1;
@@ -2453,7 +2453,7 @@
 static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies)
 {
 	int res;
-	int status, wrapuptime_notexpired = 0;
+	int status, wrapup_notexpired = 0;
 	char tech[256];
 	char *location;
 	const char *macrocontext, *macroexten;
@@ -2468,23 +2468,23 @@
 	lastqueue = tmp->lastqueue;
 
 	/* check if the wrapuptime expired so we are able to call this member. */
-	if (mem->current_wrapuptime >= 0 && wrapuptime_expired(tmp->lastcall, mem->current_wrapuptime)) {
+	if (mem->current_wrapuptime >= 0) {
 		/* the queue member has a wrapuptime configured and didn't expired yet. */
-		wrapuptime_notexpired = 1;
+		wrapup_notexpired = wrapuptime_notexpired(tmp->lastcall, mem->current_wrapuptime);
 	} else if (mem->current_wrapuptime < 0) {
 		/* the member doesn't have a specific wrapuptime configured. */
-		if (lastqueue && lastqueue->wrapuptime && wrapuptime_expired(tmp->lastcall, lastqueue->wrapuptime)) {
+		if (lastqueue && lastqueue->wrapuptime) {
 			/* if the queue member doesn't have a wrapuptime configured, check for the wrapuptime of the last queue
 			 * he received a call from. */
-			wrapuptime_notexpired = 1;
-		} else if (!lastqueue && qe->parent->wrapuptime && wrapuptime_expired(tmp->lastcall, qe->parent->wrapuptime)) {
+			wrapup_notexpired = wrapuptime_notexpired(tmp->lastcall, lastqueue->wrapuptime);
+		} else if (!lastqueue && qe->parent->wrapuptime) {
 			/* If the member didn't received a call from another queue (or shared_lastcall is not enabled), check for the
 			 * wrapuptime of the actual queue. */
-			wrapuptime_notexpired = 1;
-		}
-	}
-
-	if (wrapuptime_notexpired) {
+			wrapup_notexpired = wrapuptime_notexpired(tmp->lastcall, qe->parent->wrapuptime);
+		}
+	}
+
+	if (wrapup_notexpired) {
 		ast_debug(1, "Wrapuptime not yet expired on queue %s for %s\n", (tmp->lastqueue ? tmp->lastqueue->name : qe->parent->name), tmp->interface);
 		if (qe->chan->cdr) {
 			ast_cdr_busy(qe->chan->cdr);
@@ -5845,7 +5845,7 @@
 	char *parse;
 	struct member *cur, *newm;
 	struct member tmpmem;
-	int penalty, wrapuptime;
+	int penalty, wrapuptime = -1;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(interface);
 		AST_APP_ARG(penalty);
@@ -5892,8 +5892,6 @@
 
 	if (!ast_strlen_zero(args.wrapuptime)) {
 		wrapuptime = atoi(args.wrapuptime);
-	} else {
-		wrapuptime = -1;
 	}
 
 	/* Find the old position in the list */

Modified: team/eliel/per_member_wrapuptime/doc/manager_1_1.txt
URL: http://svn.digium.com/svn-view/asterisk/team/eliel/per_member_wrapuptime/doc/manager_1_1.txt?view=diff&rev=188735&r1=188734&r2=188735
==============================================================================
--- team/eliel/per_member_wrapuptime/doc/manager_1_1.txt (original)
+++ team/eliel/per_member_wrapuptime/doc/manager_1_1.txt Thu Apr 16 10:50:22 2009
@@ -20,6 +20,9 @@
 
 * CHANGED EVENTS AND ACTIONS
 ----------------------------
+- The QueueAdd action
+	- New header 'Wrapuptime' to specify the members wrapuptime.
+
 - The Hold/Unhold events
 	- Both are now "Hold" events
 		For hold, there's a "Status: On" header, for unhold, status is off




More information about the asterisk-commits mailing list