aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-04 17:59:18 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-04 17:59:18 +0000
commit67b5cd5dda6460b9864e7106c14872ef163eeea3 (patch)
treef86dc3f3a73d88fc54c3a43ef96d013af284d3af /apps/app_queue.c
parentab4a8f16c8d2a201f8ee92dad21d450354a0b183 (diff)
Issue #6882 - move "res=-1" out of verbosity block, minor code cleanups (casper)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@17335 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 505ac2f85..2c36f08f7 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1200,7 +1200,7 @@ static void recalc_holdtime(struct queue_ent *qe)
ast_mutex_lock(&qe->parent->lock);
if (newvalue <= qe->parent->servicelevel)
- qe->parent->callscompletedinsl++;
+ qe->parent->callscompletedinsl++;
oldvalue = qe->parent->holdtime;
qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newvalue) >> 2;
ast_mutex_unlock(&qe->parent->lock);
@@ -1751,7 +1751,7 @@ static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser
if (f) {
if (f->frametype == AST_FRAME_CONTROL) {
switch(f->subclass) {
- case AST_CONTROL_ANSWER:
+ case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
if (option_verbose > 2)
@@ -2195,7 +2195,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
/* Agent must have hung up */
ast_log(LOG_WARNING, "Agent on %s hungup on the customer. They're going to be pissed.\n", peer->name);
ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", "");
- record_abandoned(qe);
+ record_abandoned(qe);
if (qe->parent->eventwhencalled) {
manager_event(EVENT_FLAG_AGENT, "AgentDump",
"Queue: %s\r\n"
@@ -2225,7 +2225,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
if (res < 0) {
ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "SYSCOMPAT", "%s", "");
ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", qe->chan->name, peer->name);
- record_abandoned(qe);
+ record_abandoned(qe);
ast_hangup(peer);
return -1;
}
@@ -2405,7 +2405,7 @@ static int remove_from_queue(char *queuename, char *interface)
free(last_member);
if (queue_persistent_members)
- dump_queue_members(q);
+ dump_queue_members(q);
res = RES_OKAY;
} else {
@@ -2442,17 +2442,17 @@ static int add_to_queue(char *queuename, char *interface, int penalty, int pause
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);
-
+ "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);
@@ -2491,7 +2491,7 @@ static int set_member_paused(char *queuename, char *interface, int paused)
mem->paused = paused;
if (queue_persistent_members)
- dump_queue_members(q);
+ dump_queue_members(q);
ast_queue_log(q->name, "NONE", interface, (paused ? "PAUSE" : "UNPAUSE"), "%s", "");
@@ -2940,7 +2940,7 @@ static int queue_exec(struct ast_channel *chan, void *data)
check_turns:
if (ringing) {
ast_indicate(chan, AST_CONTROL_RINGING);
- } else {
+ } else {
ast_moh_start(chan, qe.moh);
}
for (;;) {
@@ -2954,8 +2954,8 @@ check_turns:
ast_queue_log(queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s while waiting their turn\n", queuename);
- res = -1;
}
+ res = -1;
break;
}
if (!res)
@@ -2977,7 +2977,7 @@ check_turns:
/* Leave if we have exceeded our queuetimeout */
if (qe.expire && (time(NULL) > qe.expire)) {
- record_abandoned(&qe);
+ record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
res = 0;
ast_queue_log(queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
@@ -3052,8 +3052,8 @@ check_turns:
ast_queue_log(queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "User disconnected from queue %s when they almost made it\n", queuename);
- res = -1;
}
+ res = -1;
break;
}
if (res && valid_exit(&qe, res)) {
@@ -3062,12 +3062,10 @@ check_turns:
}
/* exit after 'timeout' cycle if 'n' option enabled */
if (go_on) {
- if (option_verbose > 2) {
+ if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
- res = -1;
- }
ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
- record_abandoned(&qe);
+ record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
res = 0;
break;