|
|
|
@ -445,7 +445,7 @@ static void monjoin_dep_warning(void)
|
|
|
|
|
warned = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*! \brief sets the QUEUESTATUS channel variable */
|
|
|
|
|
static void set_queue_result(struct ast_channel *chan, enum queue_result res)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
@ -508,6 +508,12 @@ enum queue_member_status {
|
|
|
|
|
QUEUE_NORMAL
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*! \brief Check if members are available
|
|
|
|
|
*
|
|
|
|
|
* This function checks to see if members are available to be called. If any member
|
|
|
|
|
* is available, the function immediately returns QUEUE_NORMAL. If no members are available,
|
|
|
|
|
* the appropriate reason why is returned
|
|
|
|
|
*/
|
|
|
|
|
static enum queue_member_status get_member_status(struct call_queue *q, int max_penalty)
|
|
|
|
|
{
|
|
|
|
|
struct member *member;
|
|
|
|
@ -552,7 +558,7 @@ struct statechange {
|
|
|
|
|
int state;
|
|
|
|
|
char dev[0];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*! \brief set a member's status based on device state of that member's interface*/
|
|
|
|
|
static void *handle_statechange(struct statechange *sc)
|
|
|
|
|
{
|
|
|
|
|
struct call_queue *q;
|
|
|
|
@ -656,6 +662,7 @@ static struct {
|
|
|
|
|
.thread = AST_PTHREADT_NULL,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*! \brief Consumer of the statechange queue */
|
|
|
|
|
static void *device_state_thread(void *data)
|
|
|
|
|
{
|
|
|
|
|
struct statechange *sc = NULL;
|
|
|
|
@ -689,7 +696,7 @@ static void *device_state_thread(void *data)
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*! \brief Producer of the statechange queue */
|
|
|
|
|
static int statechange_queue(const char *dev, int state, void *ign)
|
|
|
|
|
{
|
|
|
|
|
struct statechange *sc;
|
|
|
|
@ -707,7 +714,7 @@ static int statechange_queue(const char *dev, int state, void *ign)
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*! \brief allocate space for new queue member and set fields based on parameters passed */
|
|
|
|
|
static struct member *create_queue_member(const char *interface, const char *membername, int penalty, int paused)
|
|
|
|
|
{
|
|
|
|
|
struct member *cur;
|
|
|
|
|