diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-07-26 10:27:00 -0400 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-08-01 15:42:37 -0600 |
commit | 3f98488279dbc576c7569e8dd23e3120c07bbe7e (patch) | |
tree | e4654b7a492fa8282134557a076d697c159b4aa6 /apps/app_queue.c | |
parent | ac6d98b28d2fd8022b11839f2c4febfdc7431d78 (diff) |
app_queue: Add announce-position-only-up option
Setting this option will cause the Queue application to only announce
the caller's position if it has improved since the last time that we
announced it.
Change-Id: I173a124121422209485b043e2bf784f54242fce6
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 762119e94..f297dad8d 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1683,6 +1683,7 @@ struct call_queue { unsigned int timeoutrestart:1; unsigned int announceholdtime:2; unsigned int announceposition:3; + unsigned int announceposition_only_up:1; /*!< Only announce position if it has improved */ int strategy:4; unsigned int realtime:1; unsigned int found:1; @@ -2722,6 +2723,7 @@ static void init_queue(struct call_queue *q) q->announcefrequency = 0; q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY; q->announceholdtime = 1; + q->announceposition_only_up = 0; q->announcepositionlimit = 10; /* Default 10 positions */ q->announceposition = ANNOUNCEPOSITION_YES; /* Default yes */ q->roundingseconds = 0; /* Default - don't announce seconds */ @@ -3171,6 +3173,8 @@ static void queue_set_param(struct call_queue *q, const char *param, const char } else { q->announceposition = ANNOUNCEPOSITION_NO; } + } else if (!strcasecmp(param, "announce-position-only-up")) { + q->announceposition_only_up = ast_true(val); } else if (!strcasecmp(param, "announce-position-limit")) { q->announcepositionlimit = atoi(val); } else if (!strcasecmp(param, "periodic-announce")) { @@ -3911,6 +3915,11 @@ static int say_position(struct queue_ent *qe, int ringing) return 0; } + /* Only announce if the caller's queue position has improved since last time */ + if (qe->parent->announceposition_only_up && qe->last_pos_said <= qe->pos) { + return 0; + } + if (ringing) { ast_indicate(qe->chan,-1); } else { |