[asterisk-commits] app queue: Ensure member is removed from pending when hangin... (asterisk[certified/13.13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 26 16:02:17 CST 2017


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/4813 )

Change subject: app_queue: Ensure member is removed from pending when hanging up.
......................................................................


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
(cherry picked from commit d13be4eff699449172efbd9fed0ee97f6a790b6a)
---
M apps/app_queue.c
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve; Verified
  Joshua Colp: Looks good to me, approved



diff --git a/apps/app_queue.c b/apps/app_queue.c
index c9f3aee..d3afec2 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2331,6 +2331,7 @@
 
 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);
 }
 
@@ -4184,6 +4185,7 @@
 {
 	o->stillgoing = 0;
 	ast_hangup(o->chan);
+	pending_members_remove(o->member);
 	o->chan = NULL;
 }
 
@@ -4264,6 +4266,7 @@
 		 * 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);
 
@@ -4399,7 +4402,6 @@
 		/* 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;
 	}

-- 
To view, visit https://gerrit.asterisk.org/4813
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.13
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list