diff --git a/apps/app_queue.c b/apps/app_queue.c index e951dba..2bdf722 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -8210,7 +8210,6 @@ static int add_to_queue(const char *queuename, const char *interface, const char ao2_lock(q); if ((old_member = interface_exists(q, interface)) == NULL) { if ((new_member = create_queue_member(interface, membername, penalty, paused, state_interface, q->ringinuse, skills))) { - new_member->ringinuse = q->ringinuse; new_member->dynamic = 1; member_add_to_queue(q, new_member); update_queue_ent_skills_next_check(q); @@ -10160,6 +10159,7 @@ static void reload_single_queue(struct ast_config *cfg, struct ast_flags *mask, { int new; struct call_queue *q = NULL; + struct member *mem; /*We're defining a queue*/ struct call_queue tmpq = { .name = queuename, @@ -10169,6 +10169,8 @@ static void reload_single_queue(struct ast_config *cfg, struct ast_flags *mask, const int member_reload = ast_test_flag(mask, QUEUE_RELOAD_MEMBER); int prev_weight = 0; struct ast_variable *var; + struct ao2_iterator mem_iter; + if (!(q = ao2_t_find(queues, &tmpq, OBJ_POINTER, "Find queue for reload"))) { if (queue_reload) { /* Make one then */ @@ -10237,6 +10239,15 @@ static void reload_single_queue(struct ast_config *cfg, struct ast_flags *mask, } } + mem_iter = ao2_iterator_init(q->members, 0); + while ((mem = ao2_iterator_next(&mem_iter))) { + if (mem->dynamic) { + mem->ringinuse = q->ringinuse; + } + ao2_ref(mem, -1); + } + ao2_iterator_destroy(&mem_iter); + /* At this point, we've determined if the queue has a weight, so update use_weight * as appropriate */