Allow for the position announcement to be turned off if desired.

(closes issue #8515, reported by bruno_rocha, initial patch by bruno_rocha, final patch by qwell)




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2007-10-12 20:06:37 +00:00
parent 24e2567e2d
commit fbcd884e1b
2 changed files with 32 additions and 19 deletions

View File

@@ -372,6 +372,7 @@ struct call_queue {
unsigned int wrapped:1; unsigned int wrapped:1;
unsigned int timeoutrestart:1; unsigned int timeoutrestart:1;
unsigned int announceholdtime:2; unsigned int announceholdtime:2;
unsigned int announceposition:1;
unsigned int strategy:3; unsigned int strategy:3;
unsigned int maskmemberstatus:1; unsigned int maskmemberstatus:1;
unsigned int realtime:1; unsigned int realtime:1;
@@ -803,6 +804,7 @@ static void init_queue(struct call_queue *q)
q->announcefrequency = 0; q->announcefrequency = 0;
q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY; q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY;
q->announceholdtime = 0; q->announceholdtime = 0;
q->announceholdtime = 1;
q->roundingseconds = 0; /* Default - don't announce seconds */ q->roundingseconds = 0; /* Default - don't announce seconds */
q->servicelevel = 0; q->servicelevel = 0;
q->ringinuse = 1; q->ringinuse = 1;
@@ -1013,6 +1015,8 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
q->announceholdtime = ANNOUNCEHOLDTIME_ALWAYS; q->announceholdtime = ANNOUNCEHOLDTIME_ALWAYS;
else else
q->announceholdtime = 0; q->announceholdtime = 0;
} else if (!strcasecmp(param, "announce-position")) {
q->announceposition = ast_true(val);
} else if (!strcasecmp(param, "periodic-announce")) { } else if (!strcasecmp(param, "periodic-announce")) {
if (strchr(val, ',')) { if (strchr(val, ',')) {
char *s, *buf = ast_strdupa(val); char *s, *buf = ast_strdupa(val);
@@ -1532,23 +1536,25 @@ static int say_position(struct queue_ent *qe, int ringing)
} else { } else {
ast_moh_stop(qe->chan); ast_moh_stop(qe->chan);
} }
/* Say we're next, if we are */ if (qe->parent->announceposition) {
if (qe->pos == 1) { /* Say we're next, if we are */
res = play_file(qe->chan, qe->parent->sound_next); if (qe->pos == 1) {
if (res) res = play_file(qe->chan, qe->parent->sound_next);
goto playout; if (res)
else goto playout;
goto posout; else
} else { goto posout;
res = play_file(qe->chan, qe->parent->sound_thereare); } else {
if (res) res = play_file(qe->chan, qe->parent->sound_thereare);
goto playout; if (res)
res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, (char *) NULL); /* Needs gender */ goto playout;
if (res) res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, (char *) NULL); /* Needs gender */
goto playout; if (res)
res = play_file(qe->chan, qe->parent->sound_calls); goto playout;
if (res) res = play_file(qe->chan, qe->parent->sound_calls);
goto playout; if (res)
goto playout;
}
} }
/* Round hold time to nearest minute */ /* Round hold time to nearest minute */
avgholdmins = abs(((qe->parent->holdtime + 30) - (now - qe->start)) / 60); avgholdmins = abs(((qe->parent->holdtime + 30) - (now - qe->start)) / 60);
@@ -1603,8 +1609,10 @@ static int say_position(struct queue_ent *qe, int ringing)
} }
posout: posout:
ast_verb(3, "Told %s in %s their queue position (which was %d)\n", if (qe->parent->announceposition) {
ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
qe->chan->name, qe->parent->name, qe->pos); qe->chan->name, qe->parent->name, qe->pos);
}
res = play_file(qe->chan, qe->parent->sound_thanks); res = play_file(qe->chan, qe->parent->sound_thanks);
playout: playout:

View File

@@ -199,7 +199,12 @@ monitor-type = MixMonitor
; or "less than 2 minutes" when appropriate. ; or "less than 2 minutes" when appropriate.
; ;
;announce-holdtime = yes|no|once ;announce-holdtime = yes|no|once
;
; Queue position announce?
; Either yes or no. If turned off, only the holdtime will be announced (as
; configured in announce-holdtime)
;
;announce-position = yes
; ;
; What's the rounding time for the seconds? ; What's the rounding time for the seconds?
; If this is non-zero, then we announce the seconds as well as the minutes ; If this is non-zero, then we announce the seconds as well as the minutes