Hi, After playing around with queues a bunch on 1.4.26.2, I noticed a few things, which the patch below addresses. It addresses: - Callers in position 0 will hear periodic/position announcements at a very different rate than all other callers. -- Announcements while in position 0 could be delayed up to "timeout+retry" seconds. -- This patch reduces that possible delay to only "timeout" seconds - The say_position and periodic_announcement times are in elapsed time that _includes_ the time of the announcement. -- This patch changes those times to be the time _between_ playing of those announcements
Thanks. -- James --- asterisk-1.4.26.2/apps/app_queue.c 2009-08-10 13:14:34.000000000 -0700 +++ asterisk-1.4.26.2.new/apps/app_queue.c 2010-04-25 22:25:08.000000000 -0700 @@ -345,6 +345,7 @@ time_t last_periodic_announce_time; /*!< The last time we played a periodic announcement */ int last_periodic_announce_sound; /*!< The last periodic announcement we made */ time_t last_pos; /*!< Last time we told the user their position */ + time_t last_ring_time; /*!< Last time we tried to ring the agents */ int opos; /*!< Where we started in the queue */ int handled; /*!< Whether our call was handled */ int pending; /*!< Non-zero if we are attempting to call a member */ @@ -1653,6 +1654,7 @@ res = 0; /* Set our last_pos indicators */ + time(&now); qe->last_pos = now; qe->last_pos_said = qe->pos; @@ -2131,6 +2133,8 @@ if (!res) ast_moh_start(qe->chan, qe->moh, NULL); + /* Refresh now so that frequency is time _between_ recordings */ + time(&now); /* update last_periodic_announce_time */ qe->last_periodic_announce_time = now; @@ -3292,7 +3296,8 @@ static int wait_a_bit(struct queue_ent *qe) { /* Don't need to hold the lock while we setup the outgoing calls */ - int retrywait = qe->parent->retry * 1000; + //int retrywait = qe->parent->retry * 1000; + int retrywait = RECHECK * 1000; int res = ast_waitfordigit(qe->chan, retrywait); if (res > 0 && !valid_exit(qe, res)) @@ -4003,6 +4008,7 @@ qe.max_penalty = max_penalty; qe.last_pos_said = 0; qe.last_pos = 0; + qe.last_ring_time = 0; qe.last_periodic_announce_time = time(NULL); qe.last_periodic_announce_sound = 0; qe.valid_digits = 0; @@ -4074,9 +4080,12 @@ break; } /* Try calling all queue members for 'timeout' seconds */ - res = try_calling(&qe, args.options, args.announceoverride, args.url, &tries, &noption, args.agi); - if (res) - goto stop; + if ((time(NULL) - qe.last_ring_time) > qe.parent->retry) { + res = try_calling(&qe, args.options, args.announceoverride, args.url, &tries, &noption, args.agi); + qe.last_ring_time = time(NULL); + if (res) + goto stop; + } stat = get_member_status(qe.parent, qe.max_penalty); @@ -4125,7 +4134,7 @@ /* If using dynamic realtime members, we should regenerate the member list for this queue */ update_realtime_members(qe.parent); - /* OK, we didn't get anybody; wait for 'retry' seconds; may get a digit to exit with */ + /* OK, we didn't get anybody; poll our retry */ res = wait_a_bit(&qe); if (res) goto stop; -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users