Index: apps/app_queue.c
===================================================================
--- apps/app_queue.c	(révision 37433)
+++ apps/app_queue.c	(copie de travail)
@@ -23,18 +23,18 @@
  * \author Mark Spencer <markster@digium.com>
  *
  * \arg Config in \ref Config_qu queues.conf
- *
+ *
  * \par Development notes
  * \note 2004-11-25: Persistent Dynamic Members added by:
  *             NetNation Communications (www.netnation.com)
  *             Kevin Lindsay <kevinl@netnation.com>
- *
+ *
  *             Each dynamic agent in each queue is now stored in the astdb.
  *             When asterisk is restarted, each agent will be automatically
  *             readded into their recorded queues. This feature can be
  *             configured with the 'persistent_members=<1|0>' setting in the
  *             '[general]' category in queues.conf. The default is on.
- *
+ *
  * \note 2004-06-04: Priorities in queues added by inAccess Networks (work funded by Hellas On Line (HOL) www.hol.gr).
  *
  * \note These features added by David C. Troy <dave@toad.net>:
@@ -254,7 +254,7 @@
 	QUEUE_FULL = 6,
 };

-const struct {
+const struct {
 	enum queue_result id;
 	char *text;
 } queue_results[] = {
@@ -333,7 +333,7 @@
 #define QUEUE_EVENT_VARIABLES 3

 struct call_queue {
-	ast_mutex_t lock;
+	ast_mutex_t lock;
 	char name[80];			/*!< Name */
 	char moh[80];			/*!< Music On Hold class to be used */
 	char announce[80];		/*!< Announcement to play when call is answered */
@@ -386,7 +387,7 @@
 	int rrpos;			/*!< Round Robin - position */
 	int memberdelay;		/*!< Seconds to delay connecting member to caller */
 	int autofill;			/*!< Ignore the head call status and ring an available agent */
-
+
 	struct member *members;		/*!< Head of the list of members */
 	struct queue_ent *head;		/*!< Head of the list of callers */
 	AST_LIST_ENTRY(call_queue) list;	/*!< Next call queue */
@@ -490,7 +491,7 @@
 			return QUEUE_NORMAL;
 		}
 	}
-
+
 	return result;
 }

@@ -520,7 +521,7 @@
 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE(&interfaces, curint, list) {
 		if (!strcasecmp(curint->interface, sc->dev))
-			break;
+			break;
 	}
 	AST_LIST_UNLOCK(&interfaces);

@@ -591,7 +592,7 @@
 static struct member *create_queue_member(char *interface, int penalty, int paused)
 {
 	struct member *cur;
-
+
 	if ((cur = ast_calloc(1, sizeof(*cur)))) {
 		cur->penalty = penalty;
 		cur->paused = paused;
@@ -660,14 +662,14 @@
 	q->wrapuptime = 0;
 }

-static int add_to_interfaces(char *interface)
+static int add_to_interfaces(char *interface)
 {
 	struct member_interface *curint;

 	AST_LIST_LOCK(&interfaces);
 	AST_LIST_TRAVERSE(&interfaces, curint, list) {
 		if (!strcasecmp(curint->interface, interface))
-			break;
+			break;
 	}

 	if (curint) {
@@ -677,7 +679,7 @@

 	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);
@@ -949,7 +953,7 @@
 				q->members = next;
 			remove_from_interfaces(curm->interface);
 			free(curm);
-		} else
+		} else
 			prev = curm;
 	}
 }
@@ -1150,7 +1154,7 @@
 		*reason = QUEUE_FULL;
 	else {
 		/* There's space for us, put us at the right position inside
-		 * the queue.
+		 * the queue.
 		 * Take into account the priority of the calling user */
 		inserted = 0;
 		prev = NULL;
@@ -1175,9 +1179,9 @@
 		ast_copy_string(qe->context, q->context, sizeof(qe->context));
 		q->count++;
 		res = 0;
-		manager_event(EVENT_FLAG_CALL, "Join",
+		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,
+			      qe->chan->name,
 			      S_OR(qe->chan->cid.cid_num, "unknown"), /* XXX somewhere else it is <unknown> */
 			      S_OR(qe->chan->cid.cid_name, "unknown"),
 			      q->name, qe->pos, q->count, qe->chan->uniqueid );
@@ -1304,7 +1308,7 @@
 				if (res && valid_exit(qe, res))
 					goto playout;
 			}
-
+
 			res = play_file(qe->chan, qe->parent->sound_minutes);
 			if (res && valid_exit(qe, res))
 				goto playout;
@@ -1394,7 +1398,7 @@
 	}
 	ast_mutex_unlock(&q->lock);

-	if (q->dead && !q->count) {
+	if (q->dead && !q->count) {
 		/* It's dead and nobody is in it, so kill it */
 		AST_LIST_LOCK(&queues);
 		AST_LIST_REMOVE(&queues, q, list);
@@ -1468,12 +1472,12 @@
 	struct call_queue *q;
 	struct member *mem;
 	int found = 0;
-
+
 	/* &qlock and &rq->lock already set by try_calling()
 	 * to solve deadlock */
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		if (q == rq) /* don't check myself, could deadlock */
-			continue;
+			continue;
 		ast_mutex_lock(&q->lock);
 		if (q->count && q->members) {
 			for (mem = q->members; mem; mem = mem->next) {
@@ -1489,7 +1493,7 @@
 			}
 		}
 		ast_mutex_unlock(&q->lock);
-		if (found)
+		if (found)
 			break;
 	}
 	return found;
@@ -1597,9 +1601,9 @@
 		update_dial_status(qe->parent, tmp->member, status);
 		(*busies)++;
 		return 0;
-	} else if (status != tmp->oldstatus)
+	} else if (status != tmp->oldstatus)
 		update_dial_status(qe->parent, tmp->member, status);
-
+
 	tmp->chan->appl = "AppQueue";
 	tmp->chan->data = "(Outgoing Line)";
 	tmp->chan->whentohangup = 0;
@@ -1743,7 +1747,7 @@
 		/* Stop playback */
 		ast_stopstream(chan);
 	}
-
+
 	return res;
 }

@@ -1769,7 +1773,7 @@
 	if (qe->last_periodic_announce_sound >= MAX_PERIODIC_ANNOUNCEMENTS || !strlen(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound])) {
 		qe->last_periodic_announce_sound = 0;
 	}
-
+
 	/* play the announcement */
 	res = background_file(qe, qe->chan, qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]);

@@ -1782,7 +1786,7 @@

 	/* Update the current periodic announcement to the next announcement */
 	qe->last_periodic_announce_sound++;
-
+
 	return res;
 }

@@ -1817,7 +1821,7 @@
 		}
 	}
  return;
-}
+}

 #define AST_MAX_WATCHERS 256

@@ -1837,10 +1841,10 @@
 	struct ast_channel *in = qe->chan;
 	char on[256] = "";
 	long starttime = 0;
-	long endtime = 0;
+	long endtime = 0;

 	starttime = (long) time(NULL);
-
+
 	while(*to && !peer) {
 		int numlines, retry, pos = 1;
 		struct ast_channel *watchers[AST_MAX_WATCHERS];
@@ -1902,8 +1906,8 @@
 						ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
 					/* Setup parameters */
 					o->chan = ast_request(tech, in->nativeformats, stuff, &status);
-					if (status != o->oldstatus)
-						update_dial_status(qe->parent, o->member, status);
+					if (status != o->oldstatus)
+						update_dial_status(qe->parent, o->member, status);
 					if (!o->chan) {
 						ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s'\n", tech, stuff);
 						o->stillgoing = 0;
@@ -1925,7 +1929,7 @@
 								free(o->chan->cid.cid_ani);
 							o->chan->cid.cid_ani = ast_strdup(in->cid.cid_ani);
 						}
-						if (o->chan->cid.cid_rdnis)
+						if (o->chan->cid.cid_rdnis)
 							free(o->chan->cid.cid_rdnis);
 						o->chan->cid.cid_rdnis = ast_strdup(S_OR(in->macroexten, in->exten));
 						if (ast_call(o->chan, tmpchan, 0)) {
@@ -1988,7 +1992,7 @@
 							if (!sentringing) {
 #if 0
 								ast_indicate(in, AST_CONTROL_RINGING);
-#endif
+#endif
 								sentringing++;
 							}
 							break;
@@ -2038,7 +2042,7 @@
 			}
 			ast_frfree(f);
 		}
-		if (!*to)
+		if (!*to)
 			rna(orig, qe, on);
 	}

@@ -2065,14 +2069,14 @@
 			if (option_debug)
 				ast_log(LOG_DEBUG, "It's not our turn (%s).\n", qe->chan->name);
 			res = 0;
-		}
+		}

 	} else {
 		/* This needs a lock. How many members are available to be served? */
 		ast_mutex_lock(&qe->parent->lock);
-
+
 		ch = qe->parent->head;
-
+
 		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);
@@ -2090,12 +2094,12 @@

 		if (option_debug)
 			ast_log(LOG_DEBUG, "There are %d available members.\n", avl);
-
+
 		while ((idx < avl) && (ch) && (ch != qe)) {
 			idx++;
-			ch = ch->next;
+			ch = ch->next;
 		}
-
+
 		/* If the queue entry is within avl [the number of available members] calls from the top ... */
 		if (ch && idx < avl) {
 			if (option_debug)
@@ -2106,7 +2110,7 @@
 				ast_log(LOG_DEBUG, "It's not our turn (%s).\n", qe->chan->name);
 			res = 0;
 		}
-
+
 		ast_mutex_unlock(&qe->parent->lock);
 	}

@@ -2279,7 +2283,7 @@

 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
-
+
 	for (; options && *options; options++)
 		switch (*options) {
 		case 't':
@@ -2310,11 +2314,11 @@
 		}

 	/* Hold the lock while we setup the outgoing calls */
-	if (use_weight)
+	if (use_weight)
 		AST_LIST_LOCK(&queues);
 	ast_mutex_lock(&qe->parent->lock);
 	if (option_debug)
-		ast_log(LOG_DEBUG, "%s is trying to call a queue member.\n",
+		ast_log(LOG_DEBUG, "%s is trying to call a queue member.\n",
 							qe->chan->name);
 	ast_copy_string(queuename, qe->parent->name, sizeof(queuename));
 	cur = qe->parent->members;
@@ -2328,7 +2332,7 @@

 		if (!tmp) {
 			ast_mutex_unlock(&qe->parent->lock);
-			if (use_weight)
+			if (use_weight)
 				AST_LIST_UNLOCK(&queues);
 			goto out;
 		}
@@ -2340,11 +2344,11 @@
 		/* Special case: If we ring everyone, go ahead and ring them, otherwise
 		   just calculate their metric for the appropriate strategy */
 		if (!calc_metric(qe->parent, cur, x++, qe, tmp)) {
-			/* Put them in the list of outgoing thingies...  We're ready now.
+			/* Put them in the list of outgoing thingies...  We're ready now.
 			   XXX If we're forcibly removed, these outgoing calls won't get
 			   hung up XXX */
 			tmp->q_next = outgoing;
-			outgoing = tmp;
+			outgoing = tmp;
 			/* If this line is up, don't try anybody else */
 			if (outgoing->chan && (outgoing->chan->_state == AST_STATE_UP))
 				break;
@@ -2358,7 +2362,7 @@
 		to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
 	ring_one(qe, outgoing, &numbusies);
 	ast_mutex_unlock(&qe->parent->lock);
-	if (use_weight)
+	if (use_weight)
 		AST_LIST_UNLOCK(&queues);
 	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT));
 	ast_mutex_lock(&qe->parent->lock);
@@ -2378,7 +2382,7 @@
 			ast_log(LOG_DEBUG, "%s: Nobody answered.\n", qe->chan->name);
 	} else { /* peer is valid */
 		/* Ah ha!  Someone answered within the desired timeframe.  Of course after this
-		   we will always return with -1 so that it is hung up properly after the
+		   we will always return with -1 so that it is hung up properly after the
 		   conversation.  */
 		qe->handled++;
 		if (!strcmp(qe->chan->tech->type, "Zap"))
@@ -2412,7 +2416,7 @@
 						if (holdtime < 2) {
 							play_file(peer, qe->parent->sound_lessthan);
 							ast_say_number(peer, 2, AST_DIGIT_ANY, peer->language, NULL);
-						} else
+						} else
 							ast_say_number(peer, holdtime, AST_DIGIT_ANY, peer->language, NULL);
 						play_file(peer, qe->parent->sound_minutes);
 					}
@@ -2446,6 +2450,8 @@
 		}
 		/* Stop music on hold */
 		ast_moh_stop(qe->chan);
+
+
 		/* If appropriate, log that we have a destination channel */
 		if (qe->chan->cdr)
 			ast_cdr_setdestchan(qe->chan->cdr, peer->name);
@@ -2470,7 +2483,7 @@
 					which = peer;
 				if (monitorfilename)
 					ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1 );
-				else if (qe->chan->cdr)
+				else if (qe->chan->cdr)
 					ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 );
 				else {
 					/* Last ditch effort -- no CDR, make up something */
@@ -2486,7 +2499,7 @@
 				if (!monitorfilename) {
 					if (qe->chan->cdr)
 						ast_copy_string(tmpid, qe->chan->cdr->uniqueid, sizeof(tmpid)-1);
-					else
+					else
 						snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
 				} else {
 					ast_copy_string(tmpid2, monitorfilename, sizeof(tmpid2)-1);
@@ -2513,8 +2526,8 @@

 					memset(meid, 0, sizeof(meid));
 					pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
-				}
-
+				}
+
 				snprintf(tmpid2, sizeof(tmpid2)-1, "%s.%s", tmpid, qe->parent->monfmt);

 				mixmonapp = pbx_findapp("MixMonitor");
@@ -2526,18 +2539,18 @@

 				if (!monitor_options)
 					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))
+					if (!ast_strlen_zero(monitor_exec) && !ast_strlen_zero(monitor_options))
 						snprintf(mixmonargs, sizeof(mixmonargs)-1, "%s|b%s|%s", tmpid2, monitor_options, monitor_exec);
-					else
+					else
 						snprintf(mixmonargs, sizeof(mixmonargs)-1, "%s|b%s", tmpid2, monitor_options);
-
+
 					if (option_debug)
 						ast_log(LOG_DEBUG, "Arguments being passed to MixMonitor: %s\n", mixmonargs);

@@ -2549,7 +2562,7 @@
 			}
 		}
 		/* Drop out of the queue at this point, to prepare for next caller */
-		leave_queue(qe);
+		leave_queue(qe);
  		if (!ast_strlen_zero(url) && ast_channel_supports_html(peer)) {
 			if (option_debug)
 	 			ast_log(LOG_DEBUG, "app_queue: sendurl=%s.\n", url);
@@ -2564,7 +2577,7 @@
 			if (app) {
 				agiexec = ast_strdupa(agi);
 				ret = pbx_exec(qe->chan, app, agiexec);
-			} else
+			} else
 				ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n");
 		}
 		ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "CONNECT", "%ld|%s", (long)time(NULL) - qe->start, peer->uniqueid);
@@ -2587,7 +2600,7 @@
 		bridge = ast_bridge_call(qe->chan,peer, &bridge_config);

 		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",
+			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));
 		} else if (qe->chan->_softhangup) {
@@ -2688,7 +2701,7 @@
 		}
 		value_len += res;
 	}
-
+
 	if (value_len && !cur_member) {
 		if (ast_db_put(pm_family, pm_queue->name, value))
 			ast_log(LOG_WARNING, "failed to create persistent dynamic entry!\n");
@@ -2729,10 +2742,10 @@
 				      "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;
@@ -2782,10 +2795,10 @@
 				      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);
-
+
 			res = RES_OKAY;
 		} else {
 			res = RES_OUTOFMEMORY;
@@ -2842,7 +2855,7 @@
 /* Reload dynamic queue members persisted into the astdb */
 static void reload_queue_members(void)
 {
-	char *cur_ptr;
+	char *cur_ptr;
 	char *queue_name;
 	char *member;
 	char *interface;
@@ -2899,7 +2912,7 @@
 				ast_log(LOG_WARNING, "Error converting penalty: %s: Out of range.\n", penalty_tok);
 				break;
 			}
-
+
 			if (!paused_tok) {
 				ast_log(LOG_WARNING, "Error parsing persistent member string for '%s' (paused)\n", queue_name);
 				break;
@@ -2912,7 +2925,7 @@

 			if (option_debug)
 				ast_log(LOG_DEBUG, "Reload Members: Queue: %s  Member: %s  Penalty: %d  Paused: %d\n", queue_name, interface, penalty, paused);
-
+
 			if (add_to_queue(queue_name, interface, penalty, paused, 0) == RES_OUTOFMEMORY) {
 				ast_log(LOG_ERROR, "Out of Memory when reloading persistent queue member\n");
 				break;
@@ -3077,7 +3090,7 @@
 		break;
 	case RES_EXISTS:
 		ast_log(LOG_DEBUG, "Unable to remove interface '%s' from queue '%s': Not there\n", args.interface, args.queuename);
-		if (priority_jump || ast_opt_priority_jumping)
+		if (priority_jump || ast_opt_priority_jumping)
 			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
 		pbx_builtin_setvar_helper(chan, "RQMSTATUS", "NOTINQUEUE");
 		res = 0;
@@ -3132,7 +3145,7 @@
 			penalty = 0;
 		}
 	}
-
+
 	if (args.options) {
 		if (strchr(args.options, 'j'))
 			priority_jump = 1;
@@ -3147,7 +3160,7 @@
 		break;
 	case RES_EXISTS:
 		ast_log(LOG_WARNING, "Unable to add interface '%s' to queue '%s': Already there\n", args.interface, args.queuename);
-		if (priority_jump || ast_opt_priority_jumping)
+		if (priority_jump || ast_opt_priority_jumping)
 			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
 		pbx_builtin_setvar_helper(chan, "AQMSTATUS", "MEMBERALREADY");
 		res = 0;
@@ -3190,12 +3203,12 @@
 	);
 	/* Our queue entry */
 	struct queue_ent qe;
-
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Queue requires an argument: queuename[|options[|URL][|announceoverride][|timeout]]\n");
 		return -1;
 	}
-
+
 	parse = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, parse);

@@ -3247,7 +3260,7 @@
 	if (args.options && (strchr(args.options, 'r')))
 		ringing = 1;

-	if (option_debug)
+	if (option_debug)
 		ast_log(LOG_DEBUG, "queue: %s, options: %s, url: %s, announce: %s, expires: %ld, priority: %d\n",
 			args.queuename, args.options, args.url, args.announceoverride, (long)qe.expire, prio);

@@ -3283,7 +3296,7 @@
 				res = -1;
 				break;
 			}
-			if (!res)
+			if (!res)
 				break;
 			if (valid_exit(&qe, res)) {
 				ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d", qe.digits, qe.pos);
@@ -3397,7 +3410,7 @@
 					res = 0;
 					break;
 				}
-				/* Since this is a priority queue and
+				/* Since this is a priority queue and
 				 * it is not sure that we are still at the head
 				 * of the queue, go and check for our turn again.
 				 */
@@ -3411,12 +3424,12 @@
 		}
 		/* Don't allow return code > 0 */
 		if (res >= 0 && res != AST_PBX_KEEPALIVE) {
-			res = 0;
+			res = 0;
 			if (ringing) {
 				ast_indicate(chan, -1);
 			} else {
 				ast_moh_stop(chan);
-			}
+			}
 			ast_stopstream(chan);
 		}
 		leave_queue(&qe);
@@ -3440,14 +3453,14 @@
 	struct member *m;

 	buf[0] = '\0';
-
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_ERROR, "%s requires an argument: queuename\n", cmd);
 		return -1;
 	}

 	LOCAL_USER_ADD(lu);
-
+
 	AST_LIST_LOCK(&queues);
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		if (!strcasecmp(q->name, data)) {
@@ -3481,14 +3494,14 @@
 	struct localuser *lu;

 	buf[0] = '\0';
-
+
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_ERROR, "%s requires an argument: queuename\n", cmd);
 		return -1;
 	}

 	LOCAL_USER_ADD(lu);
-
+
 	AST_LIST_LOCK(&queues);
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		if (!strcasecmp(q->name, data)) {
@@ -3522,7 +3535,7 @@
 		ast_log(LOG_ERROR, "QUEUE_MEMBER_LIST requires an argument: queuename\n");
 		return -1;
 	}
-
+
 	LOCAL_USER_ADD(u);

 	AST_LIST_LOCK(&queues);
@@ -3585,7 +3598,7 @@
 	.name = "QUEUE_WAITING_COUNT",
 	.synopsis = "Count number of calls currently waiting in a queue",
 	.syntax = "QUEUE_WAITING_COUNT(<queuename>)",
-	.desc =
+	.desc =
 "Returns the number of callers currently waiting in the specified queue.\n",
 	.read = queue_function_queuewaitingcount,
 };
@@ -3610,7 +3623,7 @@
 	char *general_val = NULL;
 	char interface[80];
 	int penalty;
-
+
 	if (!(cfg = ast_config_load("queues.conf"))) {
 		ast_log(LOG_NOTICE, "No call queueing config file (queues.conf), so no call queues\n");
 		return;
@@ -3625,7 +3638,7 @@
 	/* Chug through config file */
 	cat = NULL;
 	while ((cat = ast_category_browse(cfg, cat)) ) {
-		if (!strcasecmp(cat, "general")) {
+		if (!strcasecmp(cat, "general")) {
 			/* Initialize global settings */
 			queue_persistent_members = 0;
 			if ((general_val = ast_variable_retrieve(cfg, "general", "persistentmembers")))
@@ -3847,7 +3860,7 @@
 			}
 		} else if (s)
 			astman_append(s, "   No Members%s", term);
-		else
+		else
 			ast_cli(fd, "   No Members%s", term);
 		if (q->head) {
 			pos = 1;
@@ -3897,11 +3910,11 @@
 	char *ret = NULL;
 	int which = 0;
 	int wordlen = strlen(word);
-
+
 	AST_LIST_LOCK(&queues);
 	AST_LIST_TRAVERSE(&queues, q, list) {
 		if (!strncasecmp(word, q->name, wordlen) && ++which > state) {
-			ret = ast_strdup(q->name);
+			ret = ast_strdup(q->name);
 			break;
 		}
 	}
@@ -3910,8 +3923,8 @@
 	return ret;
 }

-/*!\brief callback to display queues status in manager
-   \addtogroup Group_AMI
+/*!\brief callback to display queues status in manager
+   \addtogroup Group_AMI
  */
 static int manager_queues_show( struct mansession *s, struct message *m )
 {
@@ -3921,7 +3934,7 @@
 	astman_append(s, "\r\n\r\n");	/* Properly terminate Manager output */

 	return RESULT_SUCCESS;
-}
+}

 /* Dump queue status */
 static int manager_queues_status( struct mansession *s, struct message *m )
@@ -3993,8 +4006,8 @@
 					      "CallerIDName: %s\r\n"
 					      "Wait: %ld\r\n"
 					      "%s"
-					      "\r\n",
-					      q->name, pos++, qe->chan->name,
+					      "\r\n",
+					      q->name, pos++, qe->chan->name,
 					      S_OR(qe->chan->cid.cid_num, "unknown"),
 					      S_OR(qe->chan->cid.cid_name, "unknown"),
 					      (long) (now - qe->start), idText);
@@ -4252,20 +4265,20 @@
 	return NULL;
 }

-static char show_queues_usage[] =
+static char show_queues_usage[] =
 "Usage: show queues\n"
 "       Provides summary information on call queues.\n";

 static struct ast_cli_entry cli_show_queues = {
-	{ "show", "queues", NULL }, queues_show,
+	{ "show", "queues", NULL }, queues_show,
 	"Show status of queues", show_queues_usage, NULL };

-static char show_queue_usage[] =
+static char show_queue_usage[] =
 "Usage: show queue\n"
 "       Provides summary information on a specified queue.\n";

 static struct ast_cli_entry cli_show_queue = {
-	{ "show", "queue", NULL }, queue_show,
+	{ "show", "queue", NULL }, queue_show,
 	"Show status of a specified queue", show_queue_usage, complete_queue };

 static char aqm_cmd_usage[] =
@@ -4315,7 +4328,7 @@
 static int load_module(void *mod)
 {
 	int res;
-
+
 	res = ast_register_application(app, queue_exec, synopsis, descrip);
 	res |= ast_cli_register(&cli_show_queue);
 	res |= ast_cli_register(&cli_show_queues);
@@ -4336,7 +4349,7 @@
 	res |= ast_custom_function_register(&queuewaitingcount_function);
 	res |= ast_devstate_add(statechange_queue, NULL);

-	if (!res) {
+	if (!res) {
 		reload_queues();
 		if (queue_persistent_members)
 			reload_queue_members();
