[asterisk-commits] irroot: branch irroot/distrotech-customers-10 r341586 - /team/irroot/distrote...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Oct 20 12:55:41 CDT 2011
Author: irroot
Date: Thu Oct 20 12:55:38 2011
New Revision: 341586
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341586
Log:
Backport autopause on busy/unavail
Modified:
team/irroot/distrotech-customers-10/apps/app_queue.c
Modified: team/irroot/distrotech-customers-10/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/apps/app_queue.c?view=diff&rev=341586&r1=341585&r2=341586
==============================================================================
--- team/irroot/distrotech-customers-10/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-10/apps/app_queue.c Thu Oct 20 12:55:38 2011
@@ -1161,6 +1161,8 @@
unsigned int realtime:1;
unsigned int found:1;
unsigned int relativeperiodicannounce:1;
+ unsigned int autopausebusy:1;
+ unsigned int autopauseunavail:1;
enum empty_conditions joinempty;
enum empty_conditions leavewhenempty;
int announcepositionlimit; /*!< How many positions we announce? */
@@ -2043,6 +2045,10 @@
q->autopause = autopause2int(val);
} else if (!strcasecmp(param, "autopausedelay")) {
q->autopausedelay = atoi(val);
+ } else if (!strcasecmp(param, "autopausebusy")) {
+ q->autopausebusy = ast_true(val);
+ } else if (!strcasecmp(param, "autopauseunavail")) {
+ q->autopauseunavail = ast_true(val);
} else if (!strcasecmp(param, "maxlen")) {
q->maxlen = atoi(val);
if (q->maxlen < 0)
@@ -3785,7 +3791,7 @@
do_hang(o);
endtime = (long) time(NULL);
endtime -= starttime;
- rna(endtime * 1000, qe, on, membername, 0);
+ rna(endtime * 1000, qe, on, membername, qe->parent->autopausebusy);
if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
if (qe->parent->timeoutrestart)
*to = orig;
@@ -3803,7 +3809,7 @@
ast_cdr_busy(in->cdr);
endtime = (long) time(NULL);
endtime -= starttime;
- rna(endtime * 1000, qe, on, membername, 0);
+ rna(endtime * 1000, qe, on, membername, qe->parent->autopauseunavail);
do_hang(o);
if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
if (qe->parent->timeoutrestart)
@@ -8654,15 +8660,12 @@
*/
static struct member *find_member_by_queuename_and_interface(const char *queuename, const char *interface)
{
- struct member tmpmem, *mem = NULL;
+ struct member *mem = NULL;
struct call_queue *q;
- ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
if ((q = load_realtime_queue(queuename))) {
ao2_lock(q);
- if ((mem = ao2_find(q->members, &tmpmem, OBJ_POINTER))) {
- ao2_ref(mem, -1);
- }
+ mem = ao2_find(q->members, interface, OBJ_KEY);
ao2_unlock(q);
queue_t_unref(q, "Expiring temporary reference.");
}
More information about the asterisk-commits
mailing list