mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
added two new features to meetme, autofill and
autopause. thanks twisted from 5577 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -317,18 +317,18 @@ struct ast_call_queue {
|
|||||||
char moh[80]; /*!< Music On Hold class to be used */
|
char moh[80]; /*!< Music On Hold class to be used */
|
||||||
char announce[80]; /*!< Announcement to play when call is answered */
|
char announce[80]; /*!< Announcement to play when call is answered */
|
||||||
char context[AST_MAX_CONTEXT]; /*!< Exit context */
|
char context[AST_MAX_CONTEXT]; /*!< Exit context */
|
||||||
unsigned int monjoin:1;
|
unsigned int monjoin:1;
|
||||||
unsigned int dead:1;
|
unsigned int dead:1;
|
||||||
unsigned int joinempty:2;
|
unsigned int joinempty:2;
|
||||||
unsigned int eventwhencalled:1;
|
unsigned int eventwhencalled:1;
|
||||||
unsigned int leavewhenempty:2;
|
unsigned int leavewhenempty:2;
|
||||||
unsigned int reportholdtime:1;
|
unsigned int reportholdtime:1;
|
||||||
unsigned int wrapped:1;
|
unsigned int wrapped:1;
|
||||||
unsigned int timeoutrestart:1;
|
unsigned int timeoutrestart:1;
|
||||||
unsigned int announceholdtime:2;
|
unsigned int announceholdtime:2;
|
||||||
unsigned int strategy:3;
|
unsigned int strategy:3;
|
||||||
unsigned int maskmemberstatus:1;
|
unsigned int maskmemberstatus:1;
|
||||||
unsigned int realtime:1;
|
unsigned int realtime:1;
|
||||||
int announcefrequency; /*!< How often to announce their position */
|
int announcefrequency; /*!< How often to announce their position */
|
||||||
int periodicannouncefrequency; /*!< How often to play periodic announcement */
|
int periodicannouncefrequency; /*!< How often to play periodic announcement */
|
||||||
int roundingseconds; /*!< How many seconds do we round to? */
|
int roundingseconds; /*!< How many seconds do we round to? */
|
||||||
@@ -356,10 +356,12 @@ struct ast_call_queue {
|
|||||||
int retry; /*!< Retry calling everyone after this amount of time */
|
int retry; /*!< Retry calling everyone after this amount of time */
|
||||||
int timeout; /*!< How long to wait for an answer */
|
int timeout; /*!< How long to wait for an answer */
|
||||||
int weight; /*!< Respective weight */
|
int weight; /*!< Respective weight */
|
||||||
|
int autopause; /*!< Auto pause queue members if they fail to answer */
|
||||||
|
|
||||||
/* Queue strategy things */
|
/* Queue strategy things */
|
||||||
int rrpos; /*!< Round Robin - position */
|
int rrpos; /*!< Round Robin - position */
|
||||||
int memberdelay; /*!< Seconds to delay connecting member to caller */
|
int memberdelay; /*!< Seconds to delay connecting member to caller */
|
||||||
|
int autofill; /*!< Ignore the head call status and ring an available agent */
|
||||||
|
|
||||||
struct member *members; /*!< Head of the list of members */
|
struct member *members; /*!< Head of the list of members */
|
||||||
struct queue_ent *head; /*!< Head of the list of callers */
|
struct queue_ent *head; /*!< Head of the list of callers */
|
||||||
@@ -369,6 +371,8 @@ struct ast_call_queue {
|
|||||||
static struct ast_call_queue *queues = NULL;
|
static struct ast_call_queue *queues = NULL;
|
||||||
AST_MUTEX_DEFINE_STATIC(qlock);
|
AST_MUTEX_DEFINE_STATIC(qlock);
|
||||||
|
|
||||||
|
static int set_member_paused(char *queuename, char *interface, int paused);
|
||||||
|
|
||||||
static void set_queue_result(struct ast_channel *chan, enum queue_result res)
|
static void set_queue_result(struct ast_channel *chan, enum queue_result res)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -666,6 +670,10 @@ static void queue_set_param(struct ast_call_queue *q, const char *param, const c
|
|||||||
q->retry = DEFAULT_RETRY;
|
q->retry = DEFAULT_RETRY;
|
||||||
} else if (!strcasecmp(param, "wrapuptime")) {
|
} else if (!strcasecmp(param, "wrapuptime")) {
|
||||||
q->wrapuptime = atoi(val);
|
q->wrapuptime = atoi(val);
|
||||||
|
} else if (!strcasecmp(param, "autofill")) {
|
||||||
|
q->autofill = ast_true(val);
|
||||||
|
} else if (!strcasecmp(param, "autopause")) {
|
||||||
|
q->autopause = ast_true(val);
|
||||||
} else if (!strcasecmp(param, "maxlen")) {
|
} else if (!strcasecmp(param, "maxlen")) {
|
||||||
q->maxlen = atoi(val);
|
q->maxlen = atoi(val);
|
||||||
if (q->maxlen < 0)
|
if (q->maxlen < 0)
|
||||||
@@ -1607,6 +1615,7 @@ static void record_abandoned(struct queue_ent *qe)
|
|||||||
static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser *outgoing, int *to, char *digit, int prebusies, int caller_disconnect)
|
static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser *outgoing, int *to, char *digit, int prebusies, int caller_disconnect)
|
||||||
{
|
{
|
||||||
char *queue = qe->parent->name;
|
char *queue = qe->parent->name;
|
||||||
|
char on[256] = "";
|
||||||
struct localuser *o;
|
struct localuser *o;
|
||||||
int found;
|
int found;
|
||||||
int numlines;
|
int numlines;
|
||||||
@@ -1650,6 +1659,7 @@ static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser
|
|||||||
peer = o;
|
peer = o;
|
||||||
}
|
}
|
||||||
} else if (o->chan && (o->chan == winner)) {
|
} else if (o->chan && (o->chan == winner)) {
|
||||||
|
ast_copy_string(on, o->member->interface, sizeof(on));
|
||||||
if (!ast_strlen_zero(o->chan->call_forward)) {
|
if (!ast_strlen_zero(o->chan->call_forward)) {
|
||||||
char tmpchan[256]="";
|
char tmpchan[256]="";
|
||||||
char *stuff;
|
char *stuff;
|
||||||
@@ -1825,8 +1835,19 @@ static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser
|
|||||||
}
|
}
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
}
|
}
|
||||||
if (!*to && (option_verbose > 2))
|
if (!*to) {
|
||||||
ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
|
if (option_verbose > 2)
|
||||||
|
ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
|
||||||
|
if (qe->parent->autopause) {
|
||||||
|
if (!set_member_paused(qe->parent->name, on, 1)) {
|
||||||
|
if (option_verbose > 2)
|
||||||
|
ast_verbose( VERBOSE_PREFIX_3 "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", on, qe->parent->name);
|
||||||
|
} else {
|
||||||
|
if (option_verbose > 2)
|
||||||
|
ast_verbose( VERBOSE_PREFIX_3 "Failed to pause Queue Member %s in queue %s!\n", on, qe->parent->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return peer;
|
return peer;
|
||||||
@@ -1841,7 +1862,7 @@ static int is_our_turn(struct queue_ent *qe)
|
|||||||
/* Atomically read the parent head -- does not need a lock */
|
/* Atomically read the parent head -- does not need a lock */
|
||||||
ch = qe->parent->head;
|
ch = qe->parent->head;
|
||||||
/* If we are now at the top of the head, break out */
|
/* If we are now at the top of the head, break out */
|
||||||
if (ch == qe) {
|
if ((ch == qe) || (qe->parent->autofill)) {
|
||||||
if (option_debug)
|
if (option_debug)
|
||||||
ast_log(LOG_DEBUG, "It's our turn (%s).\n", qe->chan->name);
|
ast_log(LOG_DEBUG, "It's our turn (%s).\n", qe->chan->name);
|
||||||
res = 1;
|
res = 1;
|
||||||
|
@@ -72,6 +72,15 @@ persistentmembers = yes
|
|||||||
;
|
;
|
||||||
;wrapuptime=15
|
;wrapuptime=15
|
||||||
;
|
;
|
||||||
|
; Autofill will follow queue strategy but push multiple calls through
|
||||||
|
; at same time.
|
||||||
|
;
|
||||||
|
;autofill=yes
|
||||||
|
;
|
||||||
|
; Autopause will pause a queue member if the y fail to answer a call
|
||||||
|
;
|
||||||
|
;autopause=yes
|
||||||
|
;
|
||||||
; Maximum number of people waiting in the queue (0 for unlimited)
|
; Maximum number of people waiting in the queue (0 for unlimited)
|
||||||
;
|
;
|
||||||
;maxlen = 0
|
;maxlen = 0
|
||||||
|
Reference in New Issue
Block a user