[svn-commits] branch oej/managerstuff r34913 - in /team/oej/managerstuff: ./ apps/ channels...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Jun 19 13:38:09 MST 2006


Author: oej
Date: Mon Jun 19 15:38:08 2006
New Revision: 34913

URL: http://svn.digium.com/view/asterisk?rev=34913&view=rev
Log:
Update - why is this branch based on 1.2??

Modified:
    team/oej/managerstuff/   (props changed)
    team/oej/managerstuff/apps/app_queue.c
    team/oej/managerstuff/apps/app_voicemail.c
    team/oej/managerstuff/channels/chan_iax2.c
    team/oej/managerstuff/channels/chan_sip.c
    team/oej/managerstuff/configs/iax.conf.sample
    team/oej/managerstuff/pbx.c

Propchange: team/oej/managerstuff/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/managerstuff/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun 19 15:38:08 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-7496,7498-34113
+/branches/1.2:1-7496,7498-34909

Modified: team/oej/managerstuff/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/managerstuff/apps/app_queue.c?rev=34913&r1=34912&r2=34913&view=diff
==============================================================================
--- team/oej/managerstuff/apps/app_queue.c (original)
+++ team/oej/managerstuff/apps/app_queue.c Mon Jun 19 15:38:08 2006
@@ -56,6 +56,10 @@
  * \ingroup applications
  */
 
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
@@ -65,10 +69,6 @@
 #include <sys/time.h>
 #include <sys/signal.h>
 #include <netinet/in.h>
-
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/lock.h"
 #include "asterisk/file.h"
@@ -285,7 +285,7 @@
 LOCAL_USER_DECL;
 
 struct queue_ent {
-	struct ast_call_queue *parent;	/*!< What queue is our parent */
+	struct call_queue *parent;	/*!< What queue is our parent */
 	char moh[80];			/*!< Name of musiconhold to be used */
 	char announce[80];		/*!< Announcement to play for member when call is answered */
 	char context[AST_MAX_CONTEXT];	/*!< Context when user exits queue */
@@ -318,20 +318,20 @@
 	struct member *next;		/*!< Next member */
 };
 
-struct ast_member_interfaces {
+struct member_interface {
 	char interface[80];
-	AST_LIST_ENTRY(ast_member_interfaces) list;    /*!< Next call queue */
+	AST_LIST_ENTRY(member_interface) list;    /*!< Next call queue */
 };
 
-static AST_LIST_HEAD_STATIC(interfaces, ast_member_interfaces);
-
-/* values used in multi-bit flags in ast_call_queue */
+static AST_LIST_HEAD_STATIC(interfaces, member_interface);
+
+/* values used in multi-bit flags in call_queue */
 #define QUEUE_EMPTY_NORMAL 1
 #define QUEUE_EMPTY_STRICT 2
 #define ANNOUNCEHOLDTIME_ALWAYS 1
 #define ANNOUNCEHOLDTIME_ONCE 2
 
-struct ast_call_queue {
+struct call_queue {
 	ast_mutex_t lock;	
 	char name[80];			/*!< Name */
 	char moh[80];			/*!< Music On Hold class to be used */
@@ -388,10 +388,10 @@
 	
 	struct member *members;		/*!< Head of the list of members */
 	struct queue_ent *head;		/*!< Head of the list of callers */
-	AST_LIST_ENTRY(ast_call_queue) list;	/*!< Next call queue */
+	AST_LIST_ENTRY(call_queue) list;	/*!< Next call queue */
 };
 
-static AST_LIST_HEAD_STATIC(queues, ast_call_queue);
+static AST_LIST_HEAD_STATIC(queues, call_queue);
 
 static int set_member_paused(char *queuename, char *interface, int paused);
 
@@ -420,25 +420,29 @@
 static char *int2strat(int strategy)
 {
 	int x;
-	for (x=0;x<sizeof(strategies) / sizeof(strategies[0]);x++) {
+
+	for (x = 0; x < sizeof(strategies) / sizeof(strategies[0]); x++) {
 		if (strategy == strategies[x].strategy)
 			return strategies[x].name;
 	}
+
 	return "<unknown>";
 }
 
 static int strat2int(const char *strategy)
 {
 	int x;
-	for (x=0;x<sizeof(strategies) / sizeof(strategies[0]);x++) {
+
+	for (x = 0; x < sizeof(strategies) / sizeof(strategies[0]); x++) {
 		if (!strcasecmp(strategy, strategies[x].name))
 			return strategies[x].strategy;
 	}
+
 	return -1;
 }
 
 /*! \brief Insert the 'new' entry after the 'prev' entry of queue 'q' */
-static inline void insert_entry(struct ast_call_queue *q, struct queue_ent *prev, struct queue_ent *new, int *pos)
+static inline void insert_entry(struct call_queue *q, struct queue_ent *prev, struct queue_ent *new, int *pos)
 {
 	struct queue_ent *cur;
 
@@ -463,7 +467,7 @@
 	QUEUE_NORMAL
 };
 
-static enum queue_member_status get_member_status(const struct ast_call_queue *q, int max_penalty)
+static enum queue_member_status get_member_status(const struct call_queue *q, int max_penalty)
 {
 	struct member *member;
 	enum queue_member_status result = QUEUE_NO_MEMBERS;
@@ -496,18 +500,17 @@
 
 static void *changethread(void *data)
 {
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct statechange *sc = data;
 	struct member *cur;
-	struct ast_member_interfaces *curint;
+	struct member_interface *curint;
 	char *loc;
 	char *technology;
 
 	technology = ast_strdupa(sc->dev);
 	loc = strchr(technology, '/');
 	if (loc) {
-		*loc = '\0';
-		loc++;
+		*loc++ = '\0';
 	} else {
 		free(sc);
 		return NULL;
@@ -520,43 +523,44 @@
 	}
 	AST_LIST_UNLOCK(&interfaces);
 
-	if (curint) {
-
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
-		AST_LIST_LOCK(&queues);
-		AST_LIST_TRAVERSE(&queues, q, list) {
-			ast_mutex_lock(&q->lock);
-			cur = q->members;
-			while(cur) {
-				if (!strcasecmp(sc->dev, cur->interface)) {
-					if (cur->status != sc->state) {
-						cur->status = sc->state;
-						if (!q->maskmemberstatus) {
-							manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
-								"Queue: %s\r\n"
-								"Location: %s\r\n"
-								"Membership: %s\r\n"
-								"Penalty: %d\r\n"
-								"CallsTaken: %d\r\n"
-								"LastCall: %d\r\n"
-								"Status: %d\r\n"
-								"Paused: %d\r\n",
-							q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
-							cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
-						}
-					}
-				}
-				cur = cur->next;
-			}
-			ast_mutex_unlock(&q->lock);
-		}
-		AST_LIST_UNLOCK(&queues);
-	} else {
+	if (!curint) {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
-	}
-	free(sc);
+		free(sc);
+		return NULL;
+        }
+
+	if (option_debug)
+		ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
+	AST_LIST_LOCK(&queues);
+	AST_LIST_TRAVERSE(&queues, q, list) {
+		ast_mutex_lock(&q->lock);
+		for (cur = q->members; cur; cur = cur->next) {
+			if (strcasecmp(sc->dev, cur->interface))
+				continue;
+
+			if (cur->status != sc->state) {
+				cur->status = sc->state;
+				if (q->maskmemberstatus)
+					continue;
+
+				manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
+					      "Queue: %s\r\n"
+					      "Location: %s\r\n"
+					      "Membership: %s\r\n"
+					      "Penalty: %d\r\n"
+					      "CallsTaken: %d\r\n"
+					      "LastCall: %d\r\n"
+					      "Status: %d\r\n"
+					      "Paused: %d\r\n",
+					      q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
+					      cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
+			}
+		}
+		ast_mutex_unlock(&q->lock);
+	}
+	AST_LIST_UNLOCK(&queues);
+
 	return NULL;
 }
 
@@ -567,17 +571,19 @@
 	struct statechange *sc;
 	pthread_t t;
 	pthread_attr_t attr;
-	
-	if ((sc = ast_calloc(1, sizeof(*sc) + strlen(dev) + 1))) {
-		sc->state = state;
-		strcpy(sc->dev, dev);
-		pthread_attr_init(&attr);
-		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-		if (ast_pthread_create(&t, &attr, changethread, sc)) {
-			ast_log(LOG_WARNING, "Failed to create update thread!\n");
-			free(sc);
-		}
-	}
+
+	if (!(sc = ast_calloc(1, sizeof(*sc) + strlen(dev) + 1)))
+		return 0;
+
+	sc->state = state;
+	strcpy(sc->dev, dev);
+	pthread_attr_init(&attr);
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+	if (ast_pthread_create(&t, &attr, changethread, sc)) {
+		ast_log(LOG_WARNING, "Failed to create update thread!\n");
+		free(sc);
+	}
+
 	return 0;
 }
 
@@ -585,8 +591,6 @@
 {
 	struct member *cur;
 	
-	/* Add a new member */
-
 	if ((cur = ast_calloc(1, sizeof(*cur)))) {
 		cur->penalty = penalty;
 		cur->paused = paused;
@@ -599,9 +603,9 @@
 	return cur;
 }
 
-static struct ast_call_queue *alloc_queue(const char *queuename)
-{
-	struct ast_call_queue *q;
+static struct call_queue *alloc_queue(const char *queuename)
+{
+	struct call_queue *q;
 
 	if ((q = ast_calloc(1, sizeof(*q)))) {
 		ast_mutex_init(&q->lock);
@@ -610,9 +614,10 @@
 	return q;
 }
 
-static void init_queue(struct ast_call_queue *q)
+static void init_queue(struct call_queue *q)
 {
 	int i;
+
 	q->dead = 0;
 	q->retry = DEFAULT_RETRY;
 	q->timeout = -1;
@@ -640,12 +645,12 @@
 	ast_copy_string(q->sound_lessthan, "queue-less-than", sizeof(q->sound_lessthan));
 	ast_copy_string(q->sound_reporthold, "queue-reporthold", sizeof(q->sound_reporthold));
 	ast_copy_string(q->sound_periodicannounce[0], "queue-periodic-announce", sizeof(q->sound_periodicannounce[0]));
-	for (i=1;i<MAX_PERIODIC_ANNOUNCEMENTS;i++) {
+	for (i = 1; i < MAX_PERIODIC_ANNOUNCEMENTS; i++) {
 		q->sound_periodicannounce[i][0]='\0';
 	}
 }
 
-static void clear_queue(struct ast_call_queue *q)
+static void clear_queue(struct call_queue *q)
 {
 	q->holdtime = 0;
 	q->callscompleted = 0;
@@ -656,7 +661,7 @@
 
 static int add_to_interfaces(char *interface) 
 {
-	struct ast_member_interfaces *curint, *newint;
+	struct member_interface *curint;
 
 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE(&interfaces, curint, list) {
@@ -664,54 +669,59 @@
 			break; 
 	}
 
-	if (!curint) {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Adding %s to the list of interfaces that make up all of our queue members.\n", interface);
-
-	        if ((newint = ast_calloc(1, sizeof(*newint)))) {
-			ast_copy_string(newint->interface, interface, sizeof(newint->interface));
-			AST_LIST_INSERT_HEAD(&interfaces, newint, list);
-		}
+	if (curint) {
+		AST_LIST_UNLOCK(&interfaces);
+		return 0;
+	}
+
+	if (option_debug)
+		ast_log(LOG_DEBUG, "Adding %s to the list of interfaces that make up all of our queue members.\n", interface);
+	
+	if ((curint = ast_calloc(1, sizeof(*curint)))) {
+		ast_copy_string(curint->interface, interface, sizeof(curint->interface));
+		AST_LIST_INSERT_HEAD(&interfaces, curint, list);
 	}
 	AST_LIST_UNLOCK(&interfaces);
 
- return 0;
+	return 0;
 }
 
 static int interface_exists_global(char *interface)
 {
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct member *mem;
 	int ret = 0;
 
 	AST_LIST_LOCK(&queues);
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		ast_mutex_lock(&q->lock);
-		for (mem = q->members; mem; mem = mem->next)
-			if (!strcasecmp(interface, mem->interface)) {
-				ast_mutex_unlock(&q->lock);
+		for (mem = q->members; mem && !ret; mem = mem->next) {
+			if (!strcasecmp(interface, mem->interface))
 				ret = 1;
-				break;
-			}
+		}
 		ast_mutex_unlock(&q->lock);
+		if (ret)
+			break;
 	}
 	AST_LIST_UNLOCK(&queues);
 
 	return ret;
 }
 
-
 static int remove_from_interfaces(char *interface)
 {
-	struct ast_member_interfaces *curint;
+	struct member_interface *curint;
 
 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&interfaces, curint, list) {
-		if (!strcasecmp(curint->interface, interface) && !interface_exists_global(interface)) {
-			if (option_debug)
-				ast_log(LOG_DEBUG, "Removing %s from the list of interfaces that make up all of our queue members.\n", interface);
-			AST_LIST_REMOVE_CURRENT(&interfaces, list);
-			free(curint);
+		if (!strcasecmp(curint->interface, interface)) {
+			if (!interface_exists_global(interface)) {
+				if (option_debug)
+					ast_log(LOG_DEBUG, "Removing %s from the list of interfaces that make up all of our queue members.\n", interface);
+				AST_LIST_REMOVE_CURRENT(&interfaces, list);
+				free(curint);
+			}
+			break;
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
@@ -722,17 +732,12 @@
 
 static void clear_and_free_interfaces(void)
 {
-	struct ast_member_interfaces *curint;
+	struct member_interface *curint;
 
 	AST_LIST_LOCK(&interfaces);
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&interfaces, curint, list) {
-		AST_LIST_REMOVE_CURRENT(&interfaces, list);
+	while ((curint = AST_LIST_REMOVE_HEAD(&interfaces, list)))
 		free(curint);
-	}
-	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&interfaces);
-
- 	return;
 }
 
 /*! \brief Configure a queue parameter.
@@ -742,11 +747,12 @@
    The failunknown flag is set for config files (and static realtime) to show
    errors for unknown parameters. It is cleared for dynamic realtime to allow
    extra fields in the tables. */
-static void queue_set_param(struct ast_call_queue *q, const char *param, const char *val, int linenum, int failunknown)
+static void queue_set_param(struct call_queue *q, const char *param, const char *val, int linenum, int failunknown)
 {
 	int i = 0;
 	char *c, *lastc;
 	char buff[80];
+
 	if (!strcasecmp(param, "music") || !strcasecmp(param, "musiconhold")) {
 		ast_copy_string(q->moh, val, sizeof(q->moh));
 	} else if (!strcasecmp(param, "announce")) {
@@ -891,29 +897,25 @@
 	}
 }
 
-static void rt_handle_member_record(struct ast_call_queue *q, char *interface, const char *penalty_str)
+static void rt_handle_member_record(struct call_queue *q, char *interface, const char *penalty_str)
 {
 	struct member *m, *prev_m;
 	int penalty = 0;
 
-	if(penalty_str) {
+	if (penalty_str) {
 		penalty = atoi(penalty_str);
-		if(penalty < 0)
+		if (penalty < 0)
 			penalty = 0;
 	}
 
 	/* Find the member, or the place to put a new one. */
-	prev_m = NULL;
-	m = q->members;
-	while (m && strcmp(m->interface, interface)) {
-		prev_m = m;
-		m = m->next;
-	}
+	for (m = q->members, prev_m = NULL;
+	     m && strcmp(m->interface, interface);
+	     prev_m = m, m = m->next);
 
 	/* Create a new one if not found, else update penalty */
 	if (!m) {
-		m = create_queue_member(interface, penalty, 0);
-		if (m) {
+		if ((m = create_queue_member(interface, penalty, 0))) {
 			m->dead = 0;
 			add_to_interfaces(interface);
 			if (prev_m) {
@@ -928,7 +930,7 @@
 	}
 }
 
-static void free_members(struct ast_call_queue *q, int all)
+static void free_members(struct call_queue *q, int all)
 {
 	/* Free non-dynamic members */
 	struct member *curm, *next, *prev = NULL;
@@ -947,7 +949,7 @@
 	}
 }
 
-static void destroy_queue(struct ast_call_queue *q)
+static void destroy_queue(struct call_queue *q)
 {
 	free_members(q, 1);
 	ast_mutex_destroy(&q->lock);
@@ -957,10 +959,10 @@
 /*!\brief Reload a single queue via realtime.
    \return Return the queue, or NULL if it doesn't exist.
    \note Should be called with the global qlock locked. */
-static struct ast_call_queue *find_queue_by_name_rt(const char *queuename, struct ast_variable *queue_vars, struct ast_config *member_config)
+static struct call_queue *find_queue_by_name_rt(const char *queuename, struct ast_variable *queue_vars, struct ast_config *member_config)
 {
 	struct ast_variable *v;
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct member *m, *prev_m, *next_m;
 	char *interface;
 	char *tmp, *tmp_name;
@@ -968,9 +970,8 @@
 
 	/* Find the queue in the in-core list (we will create a new one if not found). */
 	AST_LIST_TRAVERSE(&queues, q, list) {
-		if (!strcasecmp(q->name, queuename)) {
+		if (!strcasecmp(q->name, queuename))
 			break;
-		}
 	}
 
 	/* Static queues override realtime. */
@@ -1022,38 +1023,32 @@
 	}
 	init_queue(q);		/* Ensure defaults for all parameters not set explicitly. */
 
-	v = queue_vars;
 	memset(tmpbuf, 0, sizeof(tmpbuf));
-	while(v) {
+	for (v = queue_vars; v; v = v->next) {
 		/* Convert to dashes `-' from underscores `_' as the latter are more SQL friendly. */
-		if((tmp = strchr(v->name, '_')) != NULL) {
+		if ((tmp = strchr(v->name, '_'))) {
 			ast_copy_string(tmpbuf, v->name, sizeof(tmpbuf));
 			tmp_name = tmpbuf;
 			tmp = tmp_name;
-			while((tmp = strchr(tmp, '_')) != NULL)
+			while ((tmp = strchr(tmp, '_')))
 				*tmp++ = '-';
 		} else
 			tmp_name = v->name;
 		queue_set_param(q, tmp_name, v->value, -1, 0);
-		v = v->next;
 	}
 
 	if (q->strategy == QUEUE_STRATEGY_ROUNDROBIN)
 		rr_dep_warning();
 
 	/* Temporarily set non-dynamic members dead so we can detect deleted ones. */
-	m = q->members;
-	while (m) {
+	for (m = q->members; m; m = m->next) {
 		if (!m->dynamic)
 			m->dead = 1;
-		m = m->next;
-	}
-
-	interface = ast_category_browse(member_config, NULL);
-	while (interface) {
+	}
+
+	interface = NULL;
+	while (ast_category_browse(member_config, interface))
 		rt_handle_member_record(q, interface, ast_variable_retrieve(member_config, interface, "penalty"));
-		interface = ast_category_browse(member_config, interface);
-	}
 
 	/* Delete all realtime members that have been deleted in DB. */
 	m = q->members;
@@ -1079,11 +1074,11 @@
 	return q;
 }
 
-static struct ast_call_queue *load_realtime_queue(char *queuename)
-{
-	struct ast_variable *queue_vars = NULL;
+static struct call_queue *load_realtime_queue(char *queuename)
+{
+	struct ast_variable *queue_vars;
 	struct ast_config *member_config = NULL;
-	struct ast_call_queue *q;
+	struct call_queue *q;
 
 	/* Find the queue in the in-core list first. */
 	AST_LIST_LOCK(&queues);
@@ -1128,15 +1123,14 @@
 
 static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *reason)
 {
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct queue_ent *cur, *prev = NULL;
 	int res = -1;
 	int pos = 0;
 	int inserted = 0;
 	enum queue_member_status stat;
 
-	q = load_realtime_queue(queuename);
-	if (!q)
+	if (!(q = load_realtime_queue(queuename)))
 		return res;
 
 	AST_LIST_LOCK(&queues);
@@ -1157,7 +1151,7 @@
 		inserted = 0;
 		prev = NULL;
 		cur = q->head;
-		while(cur) {
+		while (cur) {
 			/* We have higher priority than the current user, enter
 			 * before him, after all the other users with priority
 			 * higher or equal to our priority. */
@@ -1177,7 +1171,6 @@
 		ast_copy_string(qe->context, q->context, sizeof(qe->context));
 		q->count++;
 		res = 0;
-		/* XXX missing CalledIDnum ? */
 		manager_event(EVENT_FLAG_CALL, "Join", 
 			      "Channel: %s\r\nCallerID: %s\r\nCallerIDName: %s\r\nQueue: %s\r\nPosition: %d\r\nCount: %d\r\nUniqueid: %s\r\n",
 			      qe->chan->name, 
@@ -1189,6 +1182,7 @@
 	}
 	ast_mutex_unlock(&q->lock);
 	AST_LIST_UNLOCK(&queues);
+
 	return res;
 }
 
@@ -1198,12 +1192,8 @@
 
 	ast_stopstream(chan);
 	res = ast_streamfile(chan, filename, chan->language);
-
 	if (!res)
 		res = ast_waitstream(chan, AST_DIGIT_ANY);
-	else
-		res = 0;
-
 	ast_stopstream(chan);
 
 	return res;
@@ -1237,6 +1227,7 @@
 		/* Return 1 on a successful goto */
 		return 1;
 	}
+
 	return 0;
 }
 
@@ -1247,11 +1238,11 @@
 
 	/* Check to see if this is ludicrous -- if we just announced position, don't do it again*/
 	time(&now);
-	if ( (now - qe->last_pos) < 15 )
+	if ((now - qe->last_pos) < 15)
 		return 0;
 
 	/* If either our position has changed, or we are over the freq timer, say position */
-	if ( (qe->last_pos_said == qe->pos) && ((now - qe->last_pos) < qe->parent->announcefrequency) )
+	if ((qe->last_pos_said == qe->pos) && ((now - qe->last_pos) < qe->parent->announcefrequency))
 		return 0;
 
 	ast_moh_stop(qe->chan);
@@ -1274,14 +1265,14 @@
 			goto playout;
 	}
 	/* Round hold time to nearest minute */
-	avgholdmins = abs(( (qe->parent->holdtime + 30) - (now - qe->start) ) / 60);
+	avgholdmins = abs(((qe->parent->holdtime + 30) - (now - qe->start)) / 60);
 
 	/* If they have specified a rounding then round the seconds as well */
-	if(qe->parent->roundingseconds) {
-		avgholdsecs = (abs(( (qe->parent->holdtime + 30) - (now - qe->start) )) - 60 * avgholdmins) / qe->parent->roundingseconds;
-		avgholdsecs*= qe->parent->roundingseconds;
+	if (qe->parent->roundingseconds) {
+		avgholdsecs = (abs(((qe->parent->holdtime + 30) - (now - qe->start))) - 60 * avgholdmins) / qe->parent->roundingseconds;
+		avgholdsecs *= qe->parent->roundingseconds;
 	} else {
-		avgholdsecs=0;
+		avgholdsecs = 0;
 	}
 
 	if (option_verbose > 2)
@@ -1295,17 +1286,17 @@
 		if (res && valid_exit(qe, res))
 			goto playout;
 
-		if (avgholdmins>0) {
+		if (avgholdmins > 0) {
 			if (avgholdmins < 2) {
 				res = play_file(qe->chan, qe->parent->sound_lessthan);
 				if (res && valid_exit(qe, res))
 					goto playout;
 
-				res = ast_say_number(qe->chan, 2, AST_DIGIT_ANY, qe->chan->language, (char *)NULL);
+				res = ast_say_number(qe->chan, 2, AST_DIGIT_ANY, qe->chan->language, NULL);
 				if (res && valid_exit(qe, res))
 					goto playout;
 			} else {
-				res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, (char*) NULL);
+				res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);
 				if (res && valid_exit(qe, res))
 					goto playout;
 			}
@@ -1315,7 +1306,7 @@
 				goto playout;
 		}
 		if (avgholdsecs>0) {
-			res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, qe->chan->language, (char*) NULL);
+			res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, qe->chan->language, NULL);
 			if (res && valid_exit(qe, res))
 				goto playout;
 
@@ -1367,18 +1358,16 @@
 
 static void leave_queue(struct queue_ent *qe)
 {
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct queue_ent *cur, *prev = NULL;
 	int pos = 0;
 
-	q = qe->parent;
-	if (!q)
+	if (!(q = qe->parent))
 		return;
 	ast_mutex_lock(&q->lock);
 
 	prev = NULL;
-	cur = q->head;
-	while(cur) {
+	for (cur = q->head; cur; cur = cur->next) {
 		if (cur == qe) {
 			q->count--;
 
@@ -1398,9 +1387,9 @@
 			cur->pos = ++pos;
 			prev = cur;
 		}
-		cur = cur->next;
 	}
 	ast_mutex_unlock(&q->lock);
+
 	if (q->dead && !q->count) {	
 		/* It's dead and nobody is in it, so kill it */
 		AST_LIST_LOCK(&queues);
@@ -1415,17 +1404,17 @@
 {
 	struct callattempt *oo;
 
-	while(outgoing) {
+	while (outgoing) {
 		/* Hangup any existing lines we have open */
 		if (outgoing->chan && (outgoing->chan != exception))
 			ast_hangup(outgoing->chan);
 		oo = outgoing;
-		outgoing=outgoing->q_next;
+		outgoing = outgoing->q_next;
 		free(oo);
 	}
 }
 
-static int update_status(struct ast_call_queue *q, struct member *member, int status)
+static int update_status(struct call_queue *q, struct member *member, int status)
 {
 	struct member *cur;
 
@@ -1433,29 +1422,29 @@
 		be sure it's still valid */
 	ast_mutex_lock(&q->lock);
 	for (cur = q->members; cur; cur = cur->next) {
-		if (member == cur) {
-			cur->status = status;
-			if (!q->maskmemberstatus) {
-				manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
-					"Queue: %s\r\n"
-					"Location: %s\r\n"
-					"Membership: %s\r\n"
-					"Penalty: %d\r\n"
-					"CallsTaken: %d\r\n"
-					"LastCall: %d\r\n"
-					"Status: %d\r\n"
-					"Paused: %d\r\n",
-				q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
-				cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
-			}
-			break;
+		if (member != cur)
+			continue;
+
+		cur->status = status;
+		if (!q->maskmemberstatus) {
+			manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
+				      "Queue: %s\r\n"
+				      "Location: %s\r\n"
+				      "Membership: %s\r\n"
+				      "Penalty: %d\r\n"
+				      "CallsTaken: %d\r\n"
+				      "LastCall: %d\r\n"
+				      "Status: %d\r\n"
+				      "Paused: %d\r\n",
+				      q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
+				      cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
 		}
 	}
 	ast_mutex_unlock(&q->lock);
 	return 0;
 }
 
-static int update_dial_status(struct ast_call_queue *q, struct member *member, int status)
+static int update_dial_status(struct call_queue *q, struct member *member, int status)
 {
 	if (status == AST_CAUSE_BUSY)
 		status = AST_DEVICE_BUSY;
@@ -1470,9 +1459,9 @@
 
 /* traverse all defined queues which have calls waiting and contain this member
    return 0 if no other queue has precedence (higher weight) or 1 if found  */
-static int compare_weight(struct ast_call_queue *rq, struct member *member)
-{
-	struct ast_call_queue *q;
+static int compare_weight(struct call_queue *rq, struct member *member)
+{
+	struct call_queue *q;
 	struct member *mem;
 	int found = 0;
 	
@@ -1484,13 +1473,14 @@
 		ast_mutex_lock(&q->lock);
 		if (q->count && q->members) {
 			for (mem = q->members; mem; mem = mem->next) {
-				if (!strcmp(mem->interface, member->interface)) {
-					ast_log(LOG_DEBUG, "Found matching member %s in queue '%s'\n", mem->interface, q->name);
-					if (q->weight > rq->weight) {
-						ast_log(LOG_DEBUG, "Queue '%s' (weight %d, calls %d) is preferred over '%s' (weight %d, calls %d)\n", q->name, q->weight, q->count, rq->name, rq->weight, rq->count);
-						found = 1;
-						break;
-					}
+				if (strcmp(mem->interface, member->interface))
+					continue;
+
+				ast_log(LOG_DEBUG, "Found matching member %s in queue '%s'\n", mem->interface, q->name);
+				if (q->weight > rq->weight) {
+					ast_log(LOG_DEBUG, "Queue '%s' (weight %d, calls %d) is preferred over '%s' (weight %d, calls %d)\n", q->name, q->weight, q->count, rq->name, rq->weight, rq->count);
+					found = 1;
+					break;
 				}
 			}
 		}
@@ -1562,9 +1552,6 @@
 	/* Request the peer */
 	tmp->chan = ast_request(tech, qe->chan->nativeformats, location, &status);
 	if (!tmp->chan) {			/* If we can't, just go on to the next call */
-#if 0
-		ast_log(LOG_NOTICE, "Unable to create channel of type '%s' for Queue\n", cur->tech);
-#endif			
 		if (qe->chan->cdr)
 			ast_cdr_busy(qe->chan->cdr);
 		tmp->stillgoing = 0;
@@ -1594,8 +1581,7 @@
 	tmp->chan->adsicpe = qe->chan->adsicpe;
 
 	/* Place the call, but don't wait on the answer */
-	res = ast_call(tmp->chan, location, 0);
-	if (res) {
+	if ((res = ast_call(tmp->chan, location, 0))) {
 		/* Again, keep going even if there's an error */
 		if (option_debug)
 			ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
@@ -1622,6 +1608,7 @@
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", tmp->interface);
 	}
+
 	return 1;
 }
 
@@ -1632,11 +1619,12 @@
 
 	for (cur = outgoing; cur; cur = cur->q_next) {
 		if (cur->stillgoing &&					/* Not already done */
-			!cur->chan &&					/* Isn't already going */
-			(!best || cur->metric < best->metric)) {	/* We haven't found one yet, or it's better */
-				best = cur;
-		}
-	}
+		    !cur->chan &&					/* Isn't already going */
+		    (!best || cur->metric < best->metric)) {		/* We haven't found one yet, or it's better */
+			best = cur;
+		}
+	}
+
 	return best;
 }
 
@@ -1670,6 +1658,7 @@
 		if (best->chan) /* break out with result = 1 */
 			ret = 1;
 	}
+
 	return ret;
 }
 
@@ -1693,6 +1682,7 @@
 		}
 	}
 	qe->parent->wrapped = 0;
+
 	return 0;
 }
 
@@ -1711,15 +1701,8 @@
 
 		/* Stop playback */
 		ast_stopstream(chan);
-	} else {
-		res = 0;
 	}
 	
-	/*if (res) {
-		ast_log(LOG_WARNING, "ast_streamfile failed on %s \n", chan->name);
-		res = 0;
-	}*/
-
 	return res;
 }
 
@@ -1780,7 +1763,6 @@
 /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */
 static void rna(int rnatime, struct queue_ent *qe, char *membername)
 {
-
 	if (option_verbose > 2)
 		ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", rnatime);
 	ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
@@ -1816,7 +1798,7 @@
 	long starttime = 0;
 	long endtime = 0;	
 
-	starttime = (long)time(NULL);
+	starttime = (long) time(NULL);
 	
 	while(*to && !peer) {
 		int numlines, retry, pos = 1;
@@ -1861,9 +1843,10 @@
 			} else if (o->chan && (o->chan == winner)) {
 				ast_copy_string(on, o->member->interface, sizeof(on));
 				if (!ast_strlen_zero(o->chan->call_forward)) {
-					char tmpchan[256]="";
+					char tmpchan[256];
 					char *stuff;
 					char *tech;
+
 					ast_copy_string(tmpchan, o->chan->call_forward, sizeof(tmpchan));
 					if ((stuff = strchr(tmpchan, '/'))) {
 						*stuff++ = '\0';
@@ -1977,9 +1960,8 @@
 					}
 					ast_frfree(f);
 				} else {
-					endtime = (long)time(NULL);
-					endtime -= starttime;
-					rna(endtime*1000, qe, on);
+					endtime = (long) time(NULL) - starttime;
+					rna(endtime * 1000, qe, on);
 					do_hang(o);
 					if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
 						if (qe->parent->timeoutrestart)
@@ -1991,15 +1973,9 @@
 		}
 		if (winner == in) {
 			f = ast_read(in);
-#if 0
-			if (f && (f->frametype != AST_FRAME_VOICE))
-					printf("Frame type: %d, %d\n", f->frametype, f->subclass);
-			else if (!f || (f->frametype != AST_FRAME_VOICE))
-				printf("Hangup received on %s\n", in->name);
-#endif
 			if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
 				/* Got hung up */
-				*to=-1;
+				*to = -1;
 				if (f)
 					ast_frfree(f);
 				return NULL;
@@ -2007,15 +1983,15 @@
 			if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass == '*')) {
 				if (option_verbose > 3)
 					ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
-				*to=0;
+				*to = 0;
 				ast_frfree(f);
 				return NULL;
 			}
 			if ((f->frametype == AST_FRAME_DTMF) && (f->subclass != '*') && valid_exit(qe, f->subclass)) {
 				if (option_verbose > 3)
 					ast_verbose(VERBOSE_PREFIX_3 "User pressed digit: %c\n", f->subclass);
-				*to=0;
-				*digit=f->subclass;
+				*to = 0;
+				*digit = f->subclass;
 				ast_frfree(f);
 				return NULL;
 			}
@@ -2026,7 +2002,6 @@
 	}
 
 	return peer;
-	
 }
 
 static int is_our_turn(struct queue_ent *qe)
@@ -2052,28 +2027,28 @@
 		}	
 
 	} else {
-
 		/* This needs a lock. How many members are available to be served? */
-	
 		ast_mutex_lock(&qe->parent->lock);
 			
 		ch = qe->parent->head;
-		cur = qe->parent->members;
-	
-		while (cur) {
-			if (cur->status == 1) 
-				avl++;
-			cur = cur->next;
-		}
-
-		if (option_debug)
-			ast_log(LOG_DEBUG, "There are %d available members.\n", avl);
 	
 		if (qe->parent->strategy == QUEUE_STRATEGY_RINGALL) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Even though there are %d available members, the strategy is ringall so only the head call is allowed in!\n", avl);
+				ast_log(LOG_DEBUG, "Even though there are %d available members, the strategy is ringall so only the head call is allowed in\n", avl);
 			avl = 1;
-		}
+		} else {
+			for (cur = qe->parent->members; cur; cur = cur->next) {
+				switch (cur->status) {
+				case AST_DEVICE_NOT_INUSE:
+				case AST_DEVICE_UNKNOWN:
+					avl++;
+					break;
+				}
+			}
+		}
+
+		if (option_debug)
+			ast_log(LOG_DEBUG, "There are %d available members.\n", avl);
 	
 		while ((idx < avl) && (ch) && (ch != qe)) {
 			idx++;
@@ -2147,10 +2122,11 @@
 		if ((res = ast_waitfordigit(qe->chan, RECHECK * 1000)))
 			break;
 	}
+
 	return res;
 }
 
-static int update_queue(struct ast_call_queue *q, struct member *member)
+static int update_queue(struct call_queue *q, struct member *member)
 {
 	struct member *cur;
 
@@ -2171,7 +2147,7 @@
 	return 0;
 }
 
-static int calc_metric(struct ast_call_queue *q, struct member *mem, int pos, struct queue_ent *qe, struct callattempt *tmp)
+static int calc_metric(struct call_queue *q, struct member *mem, int pos, struct queue_ent *qe, struct callattempt *tmp)
 {
 	if (mem->penalty > qe->max_penalty)
 		return -1;
@@ -2229,7 +2205,7 @@
 static int try_calling(struct queue_ent *qe, const char *options, char *announceoverride, const char *url, int *go_on, const char *agi)
 {
 	struct member *cur;
-	struct callattempt *outgoing=NULL; /* the queue we are building */
+	struct callattempt *outgoing = NULL; /* the list of calls we are building */
 	int to;
 	char oldexten[AST_MAX_EXTENSION]="";
 	char oldcontext[AST_MAX_CONTEXT]="";
@@ -2258,7 +2234,6 @@
 	char mixmonargs[1512];
 	struct ast_app *mixmonapp = NULL;
 	char *p;
-
 
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
@@ -2306,8 +2281,9 @@
 	if (!ast_strlen_zero(announceoverride))
 		announce = announceoverride;
 
-	for (;cur; cur = cur->next) {
+	for (; cur; cur = cur->next) {
 		struct callattempt *tmp = ast_calloc(1, sizeof(*tmp));
+
 		if (!tmp) {
 			ast_mutex_unlock(&qe->parent->lock);
 			if (use_weight) 
@@ -2315,13 +2291,6 @@
 			goto out;
 		}
 		tmp->stillgoing = -1;
-		if (option_debug) {
-			if (url)
-				ast_log(LOG_DEBUG, "Queue with URL=%s_\n", url);
-			else 
-				ast_log(LOG_DEBUG, "Simple queue (no URL)\n");
-		}
-
 		tmp->member = cur;		/* Never directly dereference!  Could change on reload */
 		tmp->oldstatus = cur->status;
 		tmp->lastcall = cur->lastcall;
@@ -2381,6 +2350,7 @@
 		outgoing = NULL;
 		if (announce || qe->parent->reportholdtime || qe->parent->memberdelay) {
 			int res2;
+
 			res2 = ast_autoservice_start(qe->chan);
 			if (!res2) {
 				if (qe->parent->memberdelay) {
@@ -2512,13 +2482,12 @@
 				}
 
 				if (!monitor_options)
-					monitor_options = ast_strdupa("");
+					monitor_options = "";
 				
 				if (strchr(monitor_options, '|')) {
 					ast_log(LOG_WARNING, "MONITOR_OPTIONS cannot contain a '|'! Not recording.\n");
 					mixmonapp = NULL;
 				}
-
 
 				if (mixmonapp) {
 					if (!ast_strlen_zero(monitor_exec) && !ast_strlen_zero(monitor_options)) 
@@ -2565,7 +2534,7 @@
 				      "Holdtime: %ld\r\n"
 				      "BridgedChannel: %s\r\n",
 				      queuename, qe->chan->uniqueid, peer->name, member->interface,
-				      (long)time(NULL) - qe->start,peer->uniqueid);
+				      (long) time(NULL) - qe->start,peer->uniqueid);
 		ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
 		ast_copy_string(oldexten, qe->chan->exten, sizeof(oldexten));
 		time(&callstart);
@@ -2574,10 +2543,11 @@
 
 		if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "TRANSFER", "%s|%s|%ld|%ld", 
-					  qe->chan->exten, qe->chan->context, (long)(callstart - qe->start), (long)(time(NULL) - callstart));
+				      qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
+				      (long) (time(NULL) - callstart));
 		} else if (qe->chan->_softhangup) {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETECALLER", "%ld|%ld",
-				      (long)(callstart - qe->start), (long)(time(NULL) - callstart));
+				      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 					      "Queue: %s\r\n"
@@ -2588,9 +2558,10 @@
 					      "TalkTime: %ld\r\n"
 					      "Reason: caller\r\n",
 					      queuename, qe->chan->uniqueid, peer->name, member->interface,
-					      (long)(callstart - qe->start), (long)(time(NULL) - callstart));
+					      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
 		} else {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld", (long)(callstart - qe->start), (long)(time(NULL) - callstart));
+			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld",
+				      (long) (callstart - qe->start), (long) (time(NULL) - callstart));
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 					      "Queue: %s\r\n"
@@ -2600,7 +2571,7 @@
 					      "TalkTime: %ld\r\n"
 					      "Reason: agent\r\n",
 					      queuename, qe->chan->uniqueid, peer->name, (long)(callstart - qe->start),
-					      (long)(time(NULL) - callstart));
+					      (long) (time(NULL) - callstart));
 		}
 
 		if (bridge != AST_PBX_NO_HANGUP_PEER)
@@ -2610,6 +2581,7 @@
 	}
 out:
 	hangupcalls(outgoing, NULL);
+
 	return res;
 }
 
@@ -2621,14 +2593,17 @@
 	return ast_waitfordigit(qe->chan, retrywait);
 }
 
-static struct member * interface_exists(struct ast_call_queue *q, char *interface)
+static struct member *interface_exists(struct call_queue *q, char *interface)
 {
 	struct member *mem;
 
-	if (q)
-		for (mem = q->members; mem; mem = mem->next)
-			if (!strcasecmp(interface, mem->interface))
-				return mem;
+	if (!q)
+		return NULL;
+
+	for (mem = q->members; mem; mem = mem->next) {
+		if (!strcasecmp(interface, mem->interface))
+			return mem;
+	}
 
 	return NULL;
 }
@@ -2639,7 +2614,7 @@
  * <pm_family>/<queuename> = <interface>;<penalty>;<paused>[|...]
  *
  */
-static void dump_queue_members(struct ast_call_queue *pm_queue)
+static void dump_queue_members(struct call_queue *pm_queue)
 {
 	struct member *cur_member;
 	char value[PM_MAX_LEN];
@@ -2675,109 +2650,110 @@
 
 static int remove_from_queue(char *queuename, char *interface)
 {
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct member *last_member, *look;
 	int res = RES_NOSUCHQUEUE;
 
 	AST_LIST_LOCK(&queues);
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		ast_mutex_lock(&q->lock);
-		if (!strcmp(q->name, queuename)) {
-			if ((last_member = interface_exists(q, interface))) {
-				if ((look = q->members) == last_member) {
-					q->members = last_member->next;
-				} else {
-					while (look != NULL) {
-						if (look->next == last_member) {
-							look->next = last_member->next;
-							break;
-						} else {
-							 look = look->next;
-						}
+		if (strcmp(q->name, queuename)) {
+			ast_mutex_unlock(&q->lock);
+			continue;
+		}
+
+		if ((last_member = interface_exists(q, interface))) {
+			if ((look = q->members) == last_member) {
+				q->members = last_member->next;
+			} else {
+				while (look != NULL) {
+					if (look->next == last_member) {
+						look->next = last_member->next;
+						break;
+					} else {
+						look = look->next;
 					}
 				}
-				manager_event(EVENT_FLAG_AGENT, "QueueMemberRemoved",
-						"Queue: %s\r\n"
-						"Location: %s\r\n",
-					q->name, last_member->interface);
-				free(last_member);
-
-				if (queue_persistent_members)
-					dump_queue_members(q);
-
-				res = RES_OKAY;
-			} else {
-				res = RES_EXISTS;
-			}
-			ast_mutex_unlock(&q->lock);
-			break;
+			}
+			manager_event(EVENT_FLAG_AGENT, "QueueMemberRemoved",
+				      "Queue: %s\r\n"
+				      "Location: %s\r\n",
+				      q->name, last_member->interface);
+			free(last_member);
+			
+			if (queue_persistent_members)
+				dump_queue_members(q);
+			
+			res = RES_OKAY;
+		} else {
+			res = RES_EXISTS;
 		}
 		ast_mutex_unlock(&q->lock);
-	}
-	if (res == RES_OKAY) {
+		break;
+	}
+
+	if (res == RES_OKAY)
 		remove_from_interfaces(interface);
-	}
+
 	AST_LIST_UNLOCK(&queues);
+
 	return res;
 }
 
 
 static int add_to_queue(char *queuename, char *interface, int penalty, int paused, int dump)
 {
-	struct ast_call_queue *q;
+	struct call_queue *q;
 	struct member *new_member;
 	int res = RES_NOSUCHQUEUE;
 
 	/* \note Ensure the appropriate realtime queue is loaded.  Note that this
 	 * short-circuits if the queue is already in memory. */
-	q = load_realtime_queue(queuename);
+	if (!(q = load_realtime_queue(queuename)))
+		return res;
 
 	AST_LIST_LOCK(&queues);
 
-	if (q) {
-		ast_mutex_lock(&q->lock);
-		if (interface_exists(q, interface) == NULL) {
-
-			add_to_interfaces(interface);
-
-			new_member = create_queue_member(interface, penalty, paused);
-
-			if (new_member != NULL) {
-				new_member->dynamic = 1;
-				new_member->next = q->members;
-				q->members = new_member;
-				manager_event(EVENT_FLAG_AGENT, "QueueMemberAdded",
-						"Queue: %s\r\n"
-						"Location: %s\r\n"
-						"Membership: %s\r\n"
-						"Penalty: %d\r\n"
-						"CallsTaken: %d\r\n"
-						"LastCall: %d\r\n"
-						"Status: %d\r\n"
-						"Paused: %d\r\n",
-						q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
-						new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
-
-				if (dump)
-					dump_queue_members(q);
-

[... 766 lines stripped ...]


More information about the svn-commits mailing list