Summary:ASTERISK-09323: [patch] Making the absolute minimum time between position announcements configurable
Reporter:Matthew Roth (matthew roth)Labels:
Date Opened:2007-04-26 16:20:18Date Closed:2007-07-09 21:20:53
Versions:Frequency of
Environment:Attachments:( 0) app_queue-maf-1.0.patch
( 1) queues_conf-maf-1.0.patch
Description:This patch makes the absolute minimum time between position announcements configurable in queues.conf as min-announce-frequency.


Currently, queues.conf provides the announce-frequency parameter, which allows you to define the number of seconds between position announcements.  This parameter is ignored if the caller's position has changed, but there is a check to ensure that 15 seconds pass between the start of each announcement.

This patch exposes the absolute minimum time between position announcements in queues.conf as the min-announce-frequency parameter.  The new parameter is defaulted to 15 in order to maintain backwards compatibility with existing configurations.

The min-announce-frequency parameter is useful in situations where a caller's position in queue is changing frequently.  In these situations, there will only be a 15 second interval between the start of each position announcement.  Considering that an announcement consisting of the position in queue and the estimated wait time may be 10-12 seconds in duration, the callers experience constant announcements separated by only 3-5 seconds of music on hold.

I've observed that under these conditions, the announcements tend to be played back to each caller at roughly the same time.  This is a concern, because the constant, simultaneous playback of the announcements could effect the overall performance of the Asterisk server.

The following synopsis of the say_position() function is intended to display why the position announcements occur so frequently:

static int say_position(struct queue_ent *qe)
  /* Initialize variables */

  /* Check to see if this is ludicrous -- if we just announced position, don't do it again*/
  if ((now - qe->last_pos) < 15)
     return 0;

  /* If either our position has changed, or we are over the freq timer, say position */
  if ((qe->last_pos_said == qe->pos) && ((now - qe->last_pos) < qe->parent->announcefrequency))
     return 0;

  /* Play the position announcement
     This code can take 10-12 seconds to execute */

  /* Set our last_pos indicators
     Note that the value of now was captured 10-12 seconds ago */
  qe->last_pos = now;
  qe->last_pos_said = qe->pos;

  return res;
Comments:By: Russell Bryant (russell) 2007-04-26 16:34:58

This looks good.  You just need to add the new option to queues.conf.sample.

By: Matthew Roth (matthew roth) 2007-04-27 11:08:59

A patch adding the new option to queues.conf.sample has been uploaded.

By: Russell Bryant (russell) 2007-04-27 17:09:00

This patch has been added to trunk in revision 62242.  Thanks!