Merged revisions 28968 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Sat, 20 May 2006 02:51:53 +0000 (02:51 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sat, 20 May 2006 02:51:53 +0000 (02:51 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r28968 | kpfleming | 2006-05-19 21:35:53 -0500 (Fri, 19 May 2006) | 2 lines

don't allow queue member devices to ring longer than the total queue timeout (issue #6423, reported and patched by bcnit)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@28970 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index fbdff15..e42ba36 100644 (file)
@@ -2201,7 +2201,10 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
                        free(tmp);
                }
        }
-       to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
+       if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout))
+               to = (qe->expire - now) * 1000;
+       else
+               to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
        ring_one(qe, outgoing, &numbusies);
        ast_mutex_unlock(&qe->parent->lock);
        if (use_weight)