All pastes #487747 Raw Edit

queuepatch

public c v1 · immutable
#487747 ·published 2007-05-14 16:52 UTC
rendered paste body
Index: apps/app_queue.c===================================================================--- apps/app_queue.c	(revis&#8730;£o 64186)+++ apps/app_queue.c	(c&#8730;&#8805;pia de trabalho)@@ -374,8 +374,10 @@ 	char sound_calls[80];               /*!< Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/ 	char sound_holdtime[80];            /*!< Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */ 	char sound_minutes[80];             /*!< Sound file: "minutes." (def. queue-minutes) */+	char sound_minute[80];              /*!< Sound file: "minute." (def. queue-minute) */ 	char sound_lessthan[80];            /*!< Sound file: "less-than" (def. queue-lessthan) */ 	char sound_seconds[80];             /*!< Sound file: "seconds." (def. queue-seconds) */+	char sound_second[80];              /*!< Sound file: "second." (def. queue-second) */ 	char sound_thanks[80];              /*!< Sound file: "Thank you for your patience." (def. queue-thankyou) */ 	char sound_reporthold[80];          /*!< Sound file: "Hold time" (def. queue-reporthold) */ 	char sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS][80];/*!< Sound files: Custom announce, no default */@@ -668,7 +670,9 @@ 	ast_copy_string(q->sound_calls, "queue-callswaiting", sizeof(q->sound_calls)); 	ast_copy_string(q->sound_holdtime, "queue-holdtime", sizeof(q->sound_holdtime)); 	ast_copy_string(q->sound_minutes, "queue-minutes", sizeof(q->sound_minutes));+	ast_copy_string(q->sound_minute, "queue-minute", sizeof(q->sound_minute)); 	ast_copy_string(q->sound_seconds, "queue-seconds", sizeof(q->sound_seconds));+	ast_copy_string(q->sound_second, "queue-second", sizeof(q->sound_second)); 	ast_copy_string(q->sound_thanks, "queue-thankyou", sizeof(q->sound_thanks)); 	ast_copy_string(q->sound_lessthan, "queue-less-than", sizeof(q->sound_lessthan)); 	ast_copy_string(q->sound_reporthold, "queue-reporthold", sizeof(q->sound_reporthold));@@ -806,8 +810,12 @@ 		ast_copy_string(q->sound_holdtime, val, sizeof(q->sound_holdtime)); 	} else if (!strcasecmp(param, "queue-minutes")) { 		ast_copy_string(q->sound_minutes, val, sizeof(q->sound_minutes));+	} else if (!strcasecmp(param, "queue-minute")) {+		ast_copy_string(q->sound_minute, val, sizeof(q->sound_minute)); 	} else if (!strcasecmp(param, "queue-seconds")) { 		ast_copy_string(q->sound_seconds, val, sizeof(q->sound_seconds));+	} else if (!strcasecmp(param, "queue-second")) {+		ast_copy_string(q->sound_second, val, sizeof(q->sound_second)); 	} else if (!strcasecmp(param, "queue-lessthan")) { 		ast_copy_string(q->sound_lessthan, val, sizeof(q->sound_lessthan)); 	} else if (!strcasecmp(param, "queue-thankyou")) {@@ -1312,8 +1320,8 @@ 		avgholdsecs = 0; 	} -	if (option_verbose > 2)-		ast_verbose(VERBOSE_PREFIX_3 "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);+	if (option_verbose > 1)+		ast_verbose(VERBOSE_PREFIX_3 "Hold time for %s is %d minute(s) %d second(s)\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 */@@ -1324,32 +1332,34 @@ 			goto playout;  		if (avgholdmins > 0) {-			if (avgholdmins < 2) {-				res = play_file(qe->chan, qe->parent->sound_lessthan);-				if (res && valid_exit(qe, res))-					goto playout;--				res = ast_say_number(qe->chan, 2, AST_DIGIT_ANY, qe->chan->language, NULL);-				if (res && valid_exit(qe, res))-					goto playout;-			} else {-				res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);-				if (res && valid_exit(qe, res))-					goto playout;-			}-			-			res = play_file(qe->chan, qe->parent->sound_minutes);+			res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL); 			if (res && valid_exit(qe, res)) 				goto playout;+			+            if (avgholdmins == 1) {+			    res = play_file(qe->chan, qe->parent->sound_minute);+			    if (res && valid_exit(qe, res))+			    	goto playout;+            } else {+			    res = play_file(qe->chan, qe->parent->sound_minutes);+			    if (res && valid_exit(qe, res))+			    	goto playout;+            } 		}-		if (avgholdsecs>0) {+		if (avgholdsecs > 0) { 			res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, qe->chan->language, NULL); 			if (res && valid_exit(qe, res)) 				goto playout; -			res = play_file(qe->chan, qe->parent->sound_seconds);-			if (res && valid_exit(qe, res))-				goto playout;+            if (avgholdsecs > 1) {+			    res = play_file(qe->chan, qe->parent->sound_seconds);+			    if (res && valid_exit(qe, res))+			    	goto playout;+            } else {+			    res = play_file(qe->chan, qe->parent->sound_second);+			    if (res && valid_exit(qe, res))+			    	goto playout;+            } 		}  	}Index: configs/queues.conf.sample===================================================================--- configs/queues.conf.sample	(revis&#8730;£o 64186)+++ configs/queues.conf.sample	(c&#8730;&#8805;pia de trabalho)@@ -166,8 +166,12 @@ ;queue-holdtime = queue-holdtime 			;	("minutes.") ;queue-minutes = queue-minutes+			;	("minute.")+;queue-minute = queue-minute 			;	("seconds.") ;queue-seconds = queue-seconds+			;	("second.")+;queue-second = queue-second 			;	("Thank you for your patience.") ;queue-thankyou = queue-thankyou 			;       ("less than")