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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 14 14:46:00 CST 2008


Author: mmichelson
Date: Thu Feb 14 14:46:00 2008
New Revision: 103687

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103687
Log:
Change the queue holdtime announcement to happen at any interval (not just greater than two minutes). Remove
the saying of less-than for holdtime announcements since it can lead to awkward holdtime announcements. Using
'1' as a queue-round-seconds value is no longer valid.

(closes issue #9736)
Reported by: caio1982
Patches:
      queue_announce5.diff uploaded by caio1982 (license 22)
	  Tested by: caio1982, putnopvut

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

Modified: trunk/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/trunk/UPGRADE.txt?view=diff&rev=103687&r1=103686&r2=103687
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Thu Feb 14 14:46:00 2008
@@ -160,6 +160,9 @@
   lowcost and other is not acceptable now. Look into qos.tex for description of 
   this parameter.
 
+* queues.conf: the queue-lessthan sound file option is no longer available, and the
+  queue-round-seconds option no longer takes '1' as a valid parameter.
+
 Manager:
 
 * Manager has been upgraded to version 1.1 with a lot of changes. 

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=103687&r1=103686&r2=103687
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Feb 14 14:46:00 2008
@@ -431,8 +431,8 @@
 		AST_STRING_FIELD(sound_holdtime);
 		/*! Sound file: "minutes." (def. queue-minutes) */
 		AST_STRING_FIELD(sound_minutes);
-		/*! Sound file: "less-than" (def. queue-lessthan) */
-		AST_STRING_FIELD(sound_lessthan);
+		/*! Sound file: "minute." (def. queue-minute) */
+		AST_STRING_FIELD(sound_minute);
 		/*! Sound file: "seconds." (def. queue-seconds) */
 		AST_STRING_FIELD(sound_seconds);
 		/*! Sound file: "Thank you for your patience." (def. queue-thankyou) */
@@ -939,9 +939,9 @@
 	ast_string_field_set(q, sound_calls, "queue-callswaiting");
 	ast_string_field_set(q, sound_holdtime, "queue-holdtime");
 	ast_string_field_set(q, sound_minutes, "queue-minutes");
+	ast_string_field_set(q, sound_minute, "queue-minute");
 	ast_string_field_set(q, sound_seconds, "queue-seconds");
 	ast_string_field_set(q, sound_thanks, "queue-thankyou");
-	ast_string_field_set(q, sound_lessthan, "queue-less-than");
 	ast_string_field_set(q, sound_reporthold, "queue-reporthold");
 
 	if ((q->sound_periodicannounce[0] = ast_str_create(32)))
@@ -1165,10 +1165,10 @@
 		ast_string_field_set(q, sound_holdtime, val);
 	} else if (!strcasecmp(param, "queue-minutes")) {
 		ast_string_field_set(q, sound_minutes, val);
+	} else if (!strcasecmp(param, "queue-minute")) {
+		ast_string_field_set(q, sound_minute, val);
 	} else if (!strcasecmp(param, "queue-seconds")) {
 		ast_string_field_set(q, sound_seconds, val);
-	} else if (!strcasecmp(param, "queue-lessthan")) {
-		ast_string_field_set(q, sound_lessthan, val);
 	} else if (!strcasecmp(param, "queue-thankyou")) {
 		ast_string_field_set(q, sound_thanks, val);
 	} else if (!strcasecmp(param, "queue-callerannounce")) {
@@ -1183,7 +1183,7 @@
 	} else if (!strcasecmp(param, "announce-round-seconds")) {
 		q->roundingseconds = atoi(val);
 		/* Rounding to any other values just doesn't make sense... */
-		if (!(q->roundingseconds == 0 || q->roundingseconds == 1 || q->roundingseconds == 5 || q->roundingseconds == 10
+		if (!(q->roundingseconds == 0 || q->roundingseconds == 5 || q->roundingseconds == 10
 			|| q->roundingseconds == 15 || q->roundingseconds == 20 || q->roundingseconds == 30)) {
 			if (linenum >= 0) {
 				ast_log(LOG_WARNING, "'%s' isn't a valid value for %s "
@@ -1791,7 +1791,7 @@
 		avgholdsecs = 0;
 	}
 
-	ast_verb(3, "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
+	ast_verb(3, "Hold time for %s is %d minute(s) %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
 
 	/* If the hold time is >1 min, if it's enabled, and if it's not
 	   supposed to be only once and we have already said it, say it */
@@ -1801,27 +1801,23 @@
 		if (res)
 			goto playout;
 
-		if (avgholdmins > 0) {
-			if (avgholdmins < 2) {
-				res = play_file(qe->chan, qe->parent->sound_lessthan);
-				if (res)
-					goto playout;
-
-				res = ast_say_number(qe->chan, 2, AST_DIGIT_ANY, qe->chan->language, NULL);
+		if (avgholdmins > 1) {
+			res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);
+			if (res)
+				goto playout;
+
+			if (avgholdmins == 1) {
+				res = play_file(qe->chan, qe->parent->sound_minute);
 				if (res)
 					goto playout;
 			} else {
-				res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);
+				res = play_file(qe->chan, qe->parent->sound_minutes);
 				if (res)
 					goto playout;
 			}
-			
-			res = play_file(qe->chan, qe->parent->sound_minutes);
-			if (res)
-				goto playout;
-		}
-		if (avgholdsecs>0) {
-			res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, qe->chan->language, NULL);
+		}
+		if (avgholdsecs > 1) {
+			res = ast_say_number(qe->chan, avgholdmins > 1 ? avgholdsecs : avgholdmins * 60 + avgholdsecs, AST_DIGIT_ANY, qe->chan->language, NULL);
 			if (res)
 				goto playout;
 
@@ -3262,16 +3258,22 @@
 				}
 				if (!res2 && qe->parent->reportholdtime) {
 					if (!play_file(peer, qe->parent->sound_reporthold)) {
-						int holdtime;
+						int holdtime, holdtimesecs;
 
 						time(&now);
 						holdtime = abs((now - qe->start) / 60);
-						if (holdtime < 2) {
-							play_file(peer, qe->parent->sound_lessthan);
-							ast_say_number(peer, 2, AST_DIGIT_ANY, peer->language, NULL);
-						} else
+						holdtimesecs = abs((now - qe->start));
+						if (holdtime == 1) {
 							ast_say_number(peer, holdtime, AST_DIGIT_ANY, peer->language, NULL);
-						play_file(peer, qe->parent->sound_minutes);
+							play_file(peer, qe->parent->sound_minute);
+						} else {
+							ast_say_number(peer, holdtime, AST_DIGIT_ANY, peer->language, NULL);
+							play_file(peer, qe->parent->sound_minutes);
+						}
+						if (holdtimesecs > 1) {
+							ast_say_number(peer, holdtimesecs, AST_DIGIT_ANY, peer->language, NULL);
+							play_file(peer, qe->parent->sound_seconds);
+						}
 					}
 				}
 			}
@@ -4275,7 +4277,7 @@
  * 4. Attempt to call a queue member
  * 5. If 4. did not result in a bridged call, then check for between
  *    call options such as periodic announcements etc.
- * 6. Try 4 again uless some condition (such as an expiration time) causes us to 
+ * 6. Try 4 again unless some condition (such as an expiration time) causes us to 
  *    exit the queue.
  */
 static int queue_exec(struct ast_channel *chan, void *data)

Modified: trunk/configs/queues.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=103687&r1=103686&r2=103687
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Thu Feb 14 14:46:00 2008
@@ -212,8 +212,7 @@
 ;
 ; Should we include estimated hold time in position announcements?
 ; Either yes, no, or only once.
-; Hold time will be announced as the estimated time, 
-; or "less than 2 minutes" when appropriate.
+; Hold time will be announced as the estimated time.
 ;
 ;announce-holdtime = yes|no|once
 ;
@@ -226,7 +225,7 @@
 ; What's the rounding time for the seconds?
 ; If this is non-zero, then we announce the seconds as well as the minutes
 ; rounded to this value.
-; Valid values are 0, 1, 5, 10, 15, 20, and 30.
+; Valid values are 0, 5, 10, 15, 20, and 30.
 ;
 ; announce-round-seconds = 10
 ;
@@ -247,8 +246,6 @@
 ;queue-seconds = queue-seconds
 			;	("Thank you for your patience.")
 ;queue-thankyou = queue-thankyou
-			;       ("less than")
-;queue-lessthan = queue-less-than
 			;       ("Hold time")
 ;queue-reporthold = queue-reporthold
 			;       ("All reps busy / wait for next")




More information about the asterisk-commits mailing list