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

Kevin Harwell asteriskteam at digium.com
Wed Jan 25 16:25:17 CST 2017


Kevin Harwell has uploaded a new change for review. ( https://gerrit.asterisk.org/4815 )

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

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
(cherry picked from commit f69f5cd3c43025180b61a20cc1aa906c9cf7f4f4)
---
M apps/app_queue.c
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/4815/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index 7ad644a..c3e9ce8 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4070,6 +4070,17 @@
 				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;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ad0d17c36480c92cebf840626228ce3f7e4bd65
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.8
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list