summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorMartin Tomec <tomec@ipex.cz>2016-12-09 19:23:37 +0100
committerMartin Tomec <tomec.martin@gmail.com>2016-12-19 03:45:51 -0600
commitf461f65dea636c74632abf5e6e6f66e56b387ac9 (patch)
treeb8cf915fd5678ebe40faa8afb4031373d33525ee /apps/app_queue.c
parent147b8e636ef48a07891d4ce908a81f070ddf3437 (diff)
app_queue: Ensure member is removed from pending when hanging up.
In some cases member is added to pending_members, and the channel is hung up before any extension state change. So the member would stay in pending_members forever. So when we call do_hang, we should also remove member from pending. ASTERISK-26621 #close Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 0abd512fa..9176f9360 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2351,6 +2351,7 @@ static int pending_members_cmp(void *obj, void *arg, int flags)
static void pending_members_remove(struct member *mem)
{
+ ast_debug(3, "Removed %s from pending_members\n", mem->membername);
ao2_find(pending_members, mem, OBJ_POINTER | OBJ_NODATA | OBJ_UNLINK);
}
@@ -4207,6 +4208,7 @@ static void do_hang(struct callattempt *o)
{
o->stillgoing = 0;
ast_hangup(o->chan);
+ pending_members_remove(o->member);
o->chan = NULL;
}
@@ -4287,6 +4289,7 @@ static int can_ring_entry(struct queue_ent *qe, struct callattempt *call)
* If not found add it to the container so another queue
* won't attempt to call this member at the same time.
*/
+ ast_debug(3, "Add %s to pending_members\n", call->member->membername);
ao2_link(pending_members, call->member);
ao2_unlock(pending_members);
@@ -4422,7 +4425,6 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
/* Again, keep going even if there's an error */
ast_verb(3, "Couldn't call %s\n", tmp->interface);
do_hang(tmp);
- pending_members_remove(tmp->member);
++*busies;
return 0;
}