[asterisk-commits] app queue: Evaluate realtime queues when running dialplan fu... (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 25 09:32:28 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6296 )

Change subject: app_queue: Evaluate realtime queues when running dialplan functions
......................................................................

app_queue: Evaluate realtime queues when running dialplan functions

ASTERISK-19103 #close
Reported by: Jim Van Meggelen

Change-Id: I4bd32a9d1fcebb8ac56bff0e084d4f53e31b692b
---
M apps/app_queue.c
1 file changed, 6 insertions(+), 13 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/apps/app_queue.c b/apps/app_queue.c
index b139ef7..ef40a89 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -7628,12 +7628,10 @@
 static int get_member_penalty(char *queuename, char *interface)
 {
 	int foundqueue = 0, penalty;
-	struct call_queue *q, tmpq = {
-		.name = queuename,
-	};
+	struct call_queue *q;
 	struct member *mem;
 
-	if ((q = ao2_t_find(queues, &tmpq, OBJ_POINTER, "Search for queue"))) {
+	if ((q = find_load_queue_rt_friendly(queuename))) {
 		foundqueue = 1;
 		ao2_lock(q);
 		if ((mem = interface_exists(q, interface))) {
@@ -8403,10 +8401,7 @@
 static int queue_function_var(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
 	int res = -1;
-	struct call_queue *q, tmpq = {
-		.name = data,
-	};
-
+	struct call_queue *q;
 	char interfacevar[256] = "";
 	float sl = 0;
 
@@ -8415,7 +8410,7 @@
 		return -1;
 	}
 
-	if ((q = ao2_t_find(queues, &tmpq, OBJ_POINTER, "Find for QUEUE() function"))) {
+	if ((q = find_load_queue_rt_friendly(data))) {
 		ao2_lock(q);
 		if (q->setqueuevar) {
 			sl = 0;
@@ -8813,9 +8808,7 @@
 /*! \brief Dialplan function QUEUE_MEMBER_LIST() Get list of members in a specific queue */
 static int queue_function_queuememberlist(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
-	struct call_queue *q, tmpq = {
-		.name = data,
-	};
+	struct call_queue *q;
 	struct member *m;
 
 	/* Ensure an otherwise empty list doesn't return garbage */
@@ -8826,7 +8819,7 @@
 		return -1;
 	}
 
-	if ((q = ao2_t_find(queues, &tmpq, OBJ_POINTER, "Find for QUEUE_MEMBER_LIST()"))) {
+	if ((q = find_load_queue_rt_friendly(data))) {
 		int buflen = 0, count = 0;
 		struct ao2_iterator mem_iter;
 

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4bd32a9d1fcebb8ac56bff0e084d4f53e31b692b
Gerrit-Change-Number: 6296
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170825/c917f3f8/attachment-0001.html>


More information about the asterisk-commits mailing list