Merge "app_queue: Ensure member is removed from pending when hanging up." into 13

changes/45/4645/1
zuul 9 years ago committed by Gerrit Code Review
commit c8aff2c51b

@ -2331,6 +2331,7 @@ static int pending_members_cmp(void *obj, void *arg, int flags)
static void pending_members_remove(struct member *mem) 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); ao2_find(pending_members, mem, OBJ_POINTER | OBJ_NODATA | OBJ_UNLINK);
} }
@ -4184,6 +4185,7 @@ static void do_hang(struct callattempt *o)
{ {
o->stillgoing = 0; o->stillgoing = 0;
ast_hangup(o->chan); ast_hangup(o->chan);
pending_members_remove(o->member);
o->chan = NULL; o->chan = NULL;
} }
@ -4264,6 +4266,7 @@ static int can_ring_entry(struct queue_ent *qe, struct callattempt *call)
* If not found add it to the container so another queue * If not found add it to the container so another queue
* won't attempt to call this member at the same time. * 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_link(pending_members, call->member);
ao2_unlock(pending_members); ao2_unlock(pending_members);
@ -4399,7 +4402,6 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
/* Again, keep going even if there's an error */ /* Again, keep going even if there's an error */
ast_verb(3, "Couldn't call %s\n", tmp->interface); ast_verb(3, "Couldn't call %s\n", tmp->interface);
do_hang(tmp); do_hang(tmp);
pending_members_remove(tmp->member);
++*busies; ++*busies;
return 0; return 0;
} }

Loading…
Cancel
Save