Explicitly check caller hangup in app Queue rather than a polluted res2 value.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@369262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2012-06-22 22:07:35 +00:00
parent 9f3ce626fe
commit 5e54864c5c

View File

@@ -4698,7 +4698,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
if (!res2) { if (!res2) {
if (qe->parent->memberdelay) { if (qe->parent->memberdelay) {
ast_log(LOG_NOTICE, "Delaying member connect for %d seconds\n", qe->parent->memberdelay); ast_log(LOG_NOTICE, "Delaying member connect for %d seconds\n", qe->parent->memberdelay);
res2 |= ast_safe_sleep(peer, qe->parent->memberdelay * 1000); res2 = ast_safe_sleep(peer, qe->parent->memberdelay * 1000);
} }
if (!res2 && announce) { if (!res2 && announce) {
if (play_file(peer, announce) < 0) { if (play_file(peer, announce) < 0) {
@@ -4726,8 +4726,8 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
} }
} }
} }
ast_autoservice_stop(qe->chan);
} }
res2 |= ast_autoservice_stop(qe->chan);
if (ast_check_hangup(peer)) { if (ast_check_hangup(peer)) {
/* Agent must have hung up */ /* Agent must have hung up */
ast_log(LOG_WARNING, "Agent on %s hungup on the customer.\n", peer->name); ast_log(LOG_WARNING, "Agent on %s hungup on the customer.\n", peer->name);
@@ -4745,7 +4745,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
ast_hangup(peer); ast_hangup(peer);
ao2_ref(member, -1); ao2_ref(member, -1);
goto out; goto out;
} else if (res2) { } else if (ast_check_hangup(qe->chan)) {
/* Caller must have hung up just before being connected */ /* Caller must have hung up just before being connected */
ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name); ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name);
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start); ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);