summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-08-25 12:06:41 +0000
committerJoshua Colp <jcolp@digium.com>2016-08-27 05:21:58 -0500
commitc21e6764f13a050d478e5aea6388e35ae57007e9 (patch)
tree257d7f1dcc62ed565f15bc9155a6be74fc434370 /apps/app_queue.c
parent90b7f7fdb55c3b25949a638e002402539a51bb0c (diff)
app_queue: Ensure member is removed from pending when hanging up.
When dialing channels it is possible that they may not ever leave the not in use state (Local channels in particular) by the time we cancel them. If this occurs but we know they were dialed we explicitly remove them from the pending members container so that subsequent call attempts occur. ASTERISK-26299 #close Change-Id: I6ad0d17c36480c92cebf840626228ce3f7e4bd65
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index a5cb12640..f9dd86b67 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4102,6 +4102,17 @@ static void hangupcalls(struct queue_ent *qe, struct callattempt *outgoing, stru
ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
}
ast_channel_publish_dial(qe->chan, outgoing->chan, outgoing->interface, "CANCEL");
+
+ /* When dialing channels it is possible that they may not ever
+ * leave the not in use state (Local channels in particular) by
+ * the time we cancel them. If this occurs but we know they were
+ * dialed we explicitly remove them from the pending members
+ * container so that subsequent call attempts occur.
+ */
+ if (outgoing->member->status == AST_DEVICE_NOT_INUSE) {
+ pending_members_remove(outgoing->member);
+ }
+
ast_hangup(outgoing->chan);
}
oo = outgoing;