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))) {
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;
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;
/*! \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 */
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;