mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
The diff on this looks pretty big but all I did was remove a pointless if statement (always evaluates true).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
159
apps/app_queue.c
159
apps/app_queue.c
@@ -3395,102 +3395,99 @@ check_turns:
|
|||||||
if (res)
|
if (res)
|
||||||
goto stop;
|
goto stop;
|
||||||
|
|
||||||
/* always true... */
|
int makeannouncement = 0;
|
||||||
if (!res) {
|
|
||||||
int makeannouncement = 0;
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* This is the wait loop for the head caller*/
|
/* This is the wait loop for the head caller*/
|
||||||
/* To exit, they may get their call answered; */
|
/* To exit, they may get their call answered; */
|
||||||
/* they may dial a digit from the queue context; */
|
/* they may dial a digit from the queue context; */
|
||||||
/* or, they may timeout. */
|
/* or, they may timeout. */
|
||||||
|
|
||||||
enum queue_member_status stat;
|
enum queue_member_status stat;
|
||||||
|
|
||||||
/* Leave if we have exceeded our queuetimeout */
|
/* Leave if we have exceeded our queuetimeout */
|
||||||
if (qe.expire && (time(NULL) > qe.expire)) {
|
if (qe.expire && (time(NULL) > qe.expire)) {
|
||||||
record_abandoned(&qe);
|
record_abandoned(&qe);
|
||||||
reason = QUEUE_TIMEOUT;
|
reason = QUEUE_TIMEOUT;
|
||||||
res = 0;
|
res = 0;
|
||||||
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
|
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (makeannouncement) {
|
if (makeannouncement) {
|
||||||
/* Make a position announcement, if enabled */
|
/* Make a position announcement, if enabled */
|
||||||
if (qe.parent->announcefrequency && !ringing)
|
if (qe.parent->announcefrequency && !ringing)
|
||||||
if ((res = say_position(&qe)))
|
if ((res = say_position(&qe)))
|
||||||
goto stop;
|
|
||||||
|
|
||||||
}
|
|
||||||
makeannouncement = 1;
|
|
||||||
|
|
||||||
/* Make a periodic announcement, if enabled */
|
|
||||||
if (qe.parent->periodicannouncefrequency && !ringing)
|
|
||||||
if ((res = say_periodic_announcement(&qe)))
|
|
||||||
goto stop;
|
goto stop;
|
||||||
|
|
||||||
/* Try calling all queue members for 'timeout' seconds */
|
}
|
||||||
res = try_calling(&qe, args.options, args.announceoverride, args.url, &go_on, args.agi);
|
makeannouncement = 1;
|
||||||
if (res)
|
|
||||||
|
/* Make a periodic announcement, if enabled */
|
||||||
|
if (qe.parent->periodicannouncefrequency && !ringing)
|
||||||
|
if ((res = say_periodic_announcement(&qe)))
|
||||||
goto stop;
|
goto stop;
|
||||||
|
|
||||||
stat = get_member_status(qe.parent, qe.max_penalty);
|
/* Try calling all queue members for 'timeout' seconds */
|
||||||
|
res = try_calling(&qe, args.options, args.announceoverride, args.url, &go_on, args.agi);
|
||||||
|
if (res)
|
||||||
|
goto stop;
|
||||||
|
|
||||||
/* exit after 'timeout' cycle if 'n' option enabled */
|
stat = get_member_status(qe.parent, qe.max_penalty);
|
||||||
if (go_on) {
|
|
||||||
if (option_verbose > 2)
|
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
|
|
||||||
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
|
|
||||||
record_abandoned(&qe);
|
|
||||||
reason = QUEUE_TIMEOUT;
|
|
||||||
res = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* leave the queue if no agents, if enabled */
|
/* exit after 'timeout' cycle if 'n' option enabled */
|
||||||
if (qe.parent->leavewhenempty && (stat == QUEUE_NO_MEMBERS)) {
|
if (go_on) {
|
||||||
record_abandoned(&qe);
|
if (option_verbose > 2)
|
||||||
reason = QUEUE_LEAVEEMPTY;
|
ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n");
|
||||||
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
|
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
|
||||||
res = 0;
|
record_abandoned(&qe);
|
||||||
break;
|
reason = QUEUE_TIMEOUT;
|
||||||
}
|
res = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* leave the queue if no reachable agents, if enabled */
|
/* leave the queue if no agents, if enabled */
|
||||||
if ((qe.parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
|
if (qe.parent->leavewhenempty && (stat == QUEUE_NO_MEMBERS)) {
|
||||||
record_abandoned(&qe);
|
record_abandoned(&qe);
|
||||||
reason = QUEUE_LEAVEUNAVAIL;
|
reason = QUEUE_LEAVEEMPTY;
|
||||||
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
|
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Leave if we have exceeded our queuetimeout */
|
/* leave the queue if no reachable agents, if enabled */
|
||||||
if (qe.expire && (time(NULL) > qe.expire)) {
|
if ((qe.parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
|
||||||
record_abandoned(&qe);
|
record_abandoned(&qe);
|
||||||
reason = QUEUE_TIMEOUT;
|
reason = QUEUE_LEAVEUNAVAIL;
|
||||||
res = 0;
|
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
|
||||||
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
|
res = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OK, we didn't get anybody; wait for 'retry' seconds; may get a digit to exit with */
|
/* Leave if we have exceeded our queuetimeout */
|
||||||
res = wait_a_bit(&qe);
|
if (qe.expire && (time(NULL) > qe.expire)) {
|
||||||
if (res)
|
record_abandoned(&qe);
|
||||||
goto stop;
|
reason = QUEUE_TIMEOUT;
|
||||||
|
res = 0;
|
||||||
|
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* OK, we didn't get anybody; wait for 'retry' seconds; may get a digit to exit with */
|
||||||
|
res = wait_a_bit(&qe);
|
||||||
|
if (res)
|
||||||
|
goto stop;
|
||||||
|
|
||||||
|
|
||||||
/* 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
|
* it is not sure that we are still at the head
|
||||||
* of the queue, go and check for our turn again.
|
* of the queue, go and check for our turn again.
|
||||||
*/
|
*/
|
||||||
if (!is_our_turn(&qe)) {
|
if (!is_our_turn(&qe)) {
|
||||||
if (option_debug)
|
if (option_debug)
|
||||||
ast_log(LOG_DEBUG, "Darn priorities, going back in queue (%s)!\n",
|
ast_log(LOG_DEBUG, "Darn priorities, going back in queue (%s)!\n",
|
||||||
qe.chan->name);
|
qe.chan->name);
|
||||||
goto check_turns;
|
goto check_turns;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user