[asterisk-commits] mmichelson: trunk r85527 - in /trunk: apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 12 15:06:37 CDT 2007


Author: mmichelson
Date: Fri Oct 12 15:06:37 2007
New Revision: 85527

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85527
Log:
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)



Modified:
    trunk/apps/app_queue.c
    trunk/configs/queues.conf.sample

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=85527&r1=85526&r2=85527
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri Oct 12 15:06:37 2007
@@ -372,6 +372,7 @@
 	unsigned int wrapped:1;
 	unsigned int timeoutrestart:1;
 	unsigned int announceholdtime:2;
+	unsigned int announceposition:1;
 	unsigned int strategy:3;
 	unsigned int maskmemberstatus:1;
 	unsigned int realtime:1;
@@ -803,6 +804,7 @@
 	q->announcefrequency = 0;
 	q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY;
 	q->announceholdtime = 0;
+	q->announceholdtime = 1;
 	q->roundingseconds = 0; /* Default - don't announce seconds */
 	q->servicelevel = 0;
 	q->ringinuse = 1;
@@ -1013,6 +1015,8 @@
 			q->announceholdtime = ANNOUNCEHOLDTIME_ALWAYS;
 		else
 			q->announceholdtime = 0;
+	} else if (!strcasecmp(param, "announce-position")) {
+		q->announceposition = ast_true(val);
 	} else if (!strcasecmp(param, "periodic-announce")) {
 		if (strchr(val, ',')) {
 			char *s, *buf = ast_strdupa(val);
@@ -1532,23 +1536,25 @@
 	} else {
 		ast_moh_stop(qe->chan);
 	}
-	/* Say we're next, if we are */
-	if (qe->pos == 1) {
-		res = play_file(qe->chan, qe->parent->sound_next);
-		if (res)
-			goto playout;
-		else
-			goto posout;
-	} else {
-		res = play_file(qe->chan, qe->parent->sound_thereare);
-		if (res)
-			goto playout;
-		res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, (char *) NULL); /* Needs gender */
-		if (res)
-			goto playout;
-		res = play_file(qe->chan, qe->parent->sound_calls);
-		if (res)
-			goto playout;
+	if (qe->parent->announceposition) {
+		/* Say we're next, if we are */
+		if (qe->pos == 1) {
+			res = play_file(qe->chan, qe->parent->sound_next);
+			if (res)
+				goto playout;
+			else
+				goto posout;
+		} else {
+			res = play_file(qe->chan, qe->parent->sound_thereare);
+			if (res)
+				goto playout;
+			res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, (char *) NULL); /* Needs gender */
+			if (res)
+				goto playout;
+			res = play_file(qe->chan, qe->parent->sound_calls);
+			if (res)
+				goto playout;
+		}
 	}
 	/* Round hold time to nearest minute */
 	avgholdmins = abs(((qe->parent->holdtime + 30) - (now - qe->start)) / 60);
@@ -1603,8 +1609,10 @@
 	}
 
 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);
+	}
 	res = play_file(qe->chan, qe->parent->sound_thanks);
 
 playout:

Modified: trunk/configs/queues.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=85527&r1=85526&r2=85527
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Fri Oct 12 15:06:37 2007
@@ -199,7 +199,12 @@
 ; or "less than 2 minutes" when appropriate.
 ;
 ;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?
 ; If this is non-zero, then we announce the seconds as well as the minutes




More information about the asterisk-commits mailing list