summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-08-25 09:32:28 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-08-25 09:32:28 -0500
commit179524c255c11fc48dff7092e5814f6fa8a0336b (patch)
tree18af449ebca16185f565cb1813aedd1d88f9c6fe /apps
parenta6a373751958d3d719903cacfa6cadd93b0e0597 (diff)
parent02f95d290f51e0b81c76e63ec54df3c336262f4f (diff)
Merge "app_queue: Evaluate realtime queues when running dialplan functions"
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index b139ef7b1..ef40a891c 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -7628,12 +7628,10 @@ static int set_member_value(const char *queuename, const char *interface, int pr
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 @@ stop:
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 @@ static int queue_function_var(struct ast_channel *chan, const char *cmd, char *d
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 @@ static int queue_function_queuewaitingcount(struct ast_channel *chan, const char
/*! \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 @@ static int queue_function_queuememberlist(struct ast_channel *chan, const char *
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;