int callcompletedinsl;
struct ao2_iterator memi;
struct ast_datastore *datastore, *transfer_ds;
+ const int need_weight = use_weight;
ast_channel_lock(qe->chan);
datastore = ast_channel_datastore_find(qe->chan, &dialed_interface_info, NULL);
}
/* Hold the lock while we setup the outgoing calls */
- if (use_weight)
+
+ if (need_weight)
AST_LIST_LOCK(&queues);
ao2_lock(qe->parent);
if (option_debug)
ao2_iterator_destroy(&memi);
ao2_ref(cur, -1);
ao2_unlock(qe->parent);
- if (use_weight)
+ if (need_weight)
AST_LIST_UNLOCK(&queues);
goto out;
}
ao2_iterator_destroy(&memi);
ao2_ref(cur, -1);
ao2_unlock(qe->parent);
- if (use_weight)
+ if (need_weight)
AST_LIST_UNLOCK(&queues);
free(tmp);
goto out;
ao2_iterator_destroy(&memi);
ao2_ref(cur, -1);
ao2_unlock(qe->parent);
- if (use_weight)
+ if (need_weight)
AST_LIST_UNLOCK(&queues);
free(tmp);
goto out;
ao2_iterator_destroy(&memi);
ao2_ref(cur, -1);
ao2_unlock(qe->parent);
- if (use_weight)
+ if (need_weight)
AST_LIST_UNLOCK(&queues);
free(tmp);
goto out;
++qe->pending;
ao2_unlock(qe->parent);
ring_one(qe, outgoing, &numbusies);
- if (use_weight)
+ if (need_weight)
AST_LIST_UNLOCK(&queues);
lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
/* The ast_channel_datastore_remove() function could fail here if the