[Asterisk-code-review] app queue: Ensure member is removed from pending when hangin... (asterisk[master])

Martin Tomec asteriskteam at digium.com
Fri Dec 9 13:55:45 CST 2016


Martin Tomec has uploaded a new change for review. ( https://gerrit.asterisk.org/4613 )

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
---
M apps/app_queue.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/13/4613/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index 0abd512..e5c727c 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2351,6 +2351,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);
 }
 
@@ -4207,6 +4208,7 @@
 {
 	o->stillgoing = 0;
 	ast_hangup(o->chan);
+	pending_members_remove(o->member);
 	o->chan = NULL;
 }
 
@@ -4287,6 +4289,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);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Martin Tomec <tomec.martin at gmail.com>



More information about the asterisk-code-review mailing list