mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 12:52:33 +00:00
add ability to purge callers from queue if no agents are logged in
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -1,3 +1,4 @@
|
|||||||
|
-- Add ability to purge callers from queue if no agents are logged in
|
||||||
-- Fix inband PRI indication detection
|
-- Fix inband PRI indication detection
|
||||||
-- Fix for MGCP - always request digits if no RTP stream
|
-- Fix for MGCP - always request digits if no RTP stream
|
||||||
-- Fixed seg fault for ast_control_streamfile
|
-- Fixed seg fault for ast_control_streamfile
|
||||||
|
@@ -226,6 +226,7 @@ struct ast_call_queue {
|
|||||||
int wrapped; /* Round Robin - wrapped around? */
|
int wrapped; /* Round Robin - wrapped around? */
|
||||||
int joinempty; /* Do we care if the queue has no members? */
|
int joinempty; /* Do we care if the queue has no members? */
|
||||||
int eventwhencalled; /* Generate an event when the agent is called (before pickup) */
|
int eventwhencalled; /* Generate an event when the agent is called (before pickup) */
|
||||||
|
int leavewhenempty; /* If all agents leave the queue, remove callers from the queue */
|
||||||
|
|
||||||
struct member *members; /* Member channels to be tried */
|
struct member *members; /* Member channels to be tried */
|
||||||
struct queue_ent *head; /* Start of the actual queue */
|
struct queue_ent *head; /* Start of the actual queue */
|
||||||
@@ -912,6 +913,12 @@ static int wait_our_turn(struct queue_ent *qe, int ringing)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* leave the queue if no agents, if enabled */
|
||||||
|
if (!(qe->parent->members) && qe->parent->leavewhenempty) {
|
||||||
|
leave_queue(qe);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make a position announcement, if enabled */
|
/* Make a position announcement, if enabled */
|
||||||
if (qe->parent->announcefrequency && !ringing)
|
if (qe->parent->announcefrequency && !ringing)
|
||||||
say_position(qe);
|
say_position(qe);
|
||||||
@@ -1626,7 +1633,7 @@ check_turns:
|
|||||||
/* This is the wait loop for the head caller*/
|
/* This is the wait loop for the head caller*/
|
||||||
/* To exit, they may get their call answered; */
|
/* To exit, they may get their call answered; */
|
||||||
/* they may dial a digit from the queue context; */
|
/* they may dial a digit from the queue context; */
|
||||||
/* or, they may may timeout. */
|
/* or, they may timeout. */
|
||||||
|
|
||||||
/* Leave if we have exceeded our queuetimeout */
|
/* Leave if we have exceeded our queuetimeout */
|
||||||
if (qe.queuetimeout && ( (time(NULL) - qe.start) >= qe.queuetimeout) ) {
|
if (qe.queuetimeout && ( (time(NULL) - qe.start) >= qe.queuetimeout) ) {
|
||||||
@@ -1634,6 +1641,12 @@ check_turns:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* leave the queue if no agents, if enabled */
|
||||||
|
if (!((qe.parent)->members) && (qe.parent)->leavewhenempty) {
|
||||||
|
leave_queue(&qe);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make a position announcement, if enabled */
|
/* Make a position announcement, if enabled */
|
||||||
if (qe.parent->announcefrequency && !ringing)
|
if (qe.parent->announcefrequency && !ringing)
|
||||||
say_position(&qe);
|
say_position(&qe);
|
||||||
@@ -1872,6 +1885,8 @@ static void reload_queues(void)
|
|||||||
}
|
}
|
||||||
} else if (!strcasecmp(var->name, "joinempty")) {
|
} else if (!strcasecmp(var->name, "joinempty")) {
|
||||||
q->joinempty = ast_true(var->value);
|
q->joinempty = ast_true(var->value);
|
||||||
|
} else if (!strcasecmp(var->name, "leavewhenempty")) {
|
||||||
|
q->leavewhenempty = ast_true(var->value);
|
||||||
} else if (!strcasecmp(var->name, "eventwhencalled")) {
|
} else if (!strcasecmp(var->name, "eventwhencalled")) {
|
||||||
q->eventwhencalled = ast_true(var->value);
|
q->eventwhencalled = ast_true(var->value);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -113,6 +113,10 @@
|
|||||||
;
|
;
|
||||||
; joinempty = yes
|
; joinempty = yes
|
||||||
;
|
;
|
||||||
|
; If you wish to remove callers from the queue if there are no agents present, set this to yes
|
||||||
|
;
|
||||||
|
; leavewhenempty = yes
|
||||||
|
;
|
||||||
; Asterisk can generate AgentCalled events when an agent is rung, if this is turned on
|
; Asterisk can generate AgentCalled events when an agent is rung, if this is turned on
|
||||||
; (may generate a LOT of extra manager events)
|
; (may generate a LOT of extra manager events)
|
||||||
;
|
;
|
||||||
|
Reference in New Issue
Block a user