[asterisk-commits] tilghman: branch 1.6.2 r218052 - in /branches/1.6.2: ./ apps/app_queue.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 11 00:59:12 CDT 2009
Author: tilghman
Date: Fri Sep 11 00:59:08 2009
New Revision: 218052
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=218052
Log:
Merged revisions 217990 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r217990 | tilghman | 2009-09-10 18:54:51 -0500 (Thu, 10 Sep 2009) | 10 lines
Merged revisions 217989 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r217989 | tilghman | 2009-09-10 18:52:22 -0500 (Thu, 10 Sep 2009) | 3 lines
Don't ring another channel, if there's not enough time for a queue member to answer.
(Fixes AST-228)
........
................
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/apps/app_queue.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.2/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/apps/app_queue.c?view=diff&rev=218052&r1=218051&r2=218052
==============================================================================
--- branches/1.6.2/apps/app_queue.c (original)
+++ branches/1.6.2/apps/app_queue.c Fri Sep 11 00:59:08 2009
@@ -2512,6 +2512,7 @@
/* Inherit specially named variables from parent channel */
ast_channel_inherit_variables(qe->chan, tmp->chan);
+ ast_channel_datastore_inherit(qe->chan, tmp->chan);
/* Presense of ADSI CPE on outgoing channel follows ours */
tmp->chan->adsicpe = qe->chan->adsicpe;
@@ -2872,7 +2873,11 @@
*to = 0;
return NULL;
}
+
+ /* Poll for events from both the incoming channel as well as any outgoing channels */
winner = ast_waitfor_n(watchers, pos, to);
+
+ /* Service all of the outgoing channels */
for (o = start; o; o = o->call_next) {
if (o->stillgoing && (o->chan) && (o->chan->_state == AST_STATE_UP)) {
if (!peer) {
@@ -2966,7 +2971,11 @@
if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
if (qe->parent->timeoutrestart)
*to = orig;
- ring_one(qe, outgoing, &numbusies);
+ /* Have enough time for a queue member to answer? */
+ if (*to > 500) {
+ ring_one(qe, outgoing, &numbusies);
+ starttime = (long) time(NULL);
+ }
}
numbusies++;
break;
@@ -2981,7 +2990,10 @@
if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
if (qe->parent->timeoutrestart)
*to = orig;
- ring_one(qe, outgoing, &numbusies);
+ if (*to > 500) {
+ ring_one(qe, outgoing, &numbusies);
+ starttime = (long) time(NULL);
+ }
}
numbusies++;
break;
@@ -2996,18 +3008,23 @@
}
}
ast_frfree(f);
- } else {
+ } else { /* ast_read() returned NULL */
endtime = (long) time(NULL) - starttime;
rna(endtime * 1000, qe, on, membername, 1);
do_hang(o);
if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
if (qe->parent->timeoutrestart)
*to = orig;
- ring_one(qe, outgoing, &numbusies);
+ if (*to > 500) {
+ ring_one(qe, outgoing, &numbusies);
+ starttime = (long) time(NULL);
+ }
}
}
}
}
+
+ /* If we received an event from the caller, deal with it. */
if (winner == in) {
f = ast_read(in);
if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
More information about the asterisk-commits
mailing list