[Asterisk-code-review] say.c: Fix file locations for second, seconds, minute, minut... (asterisk[master])

Rusty Newton asteriskteam at digium.com
Fri Jul 14 13:59:32 CDT 2017


Rusty Newton has uploaded this change for review. ( https://gerrit.asterisk.org/6024


Change subject: say.c: Fix file locations for second, seconds, minute, minutes files
......................................................................

say.c: Fix file locations for second, seconds, minute, minutes files

The seconds and minutes files have always existed in the core directory. So
say.c has always been calling the wrong location (under digits/) for those two
files and in the case of second and minute they didn't exist in core at all.

The 1.6 sounds release moves the second and minute files into core from
Extra for the languages that already had them. A future release will include
the second and minute files for languages that didn't already have them.

This patch just changes all the target locations for second, seconds,
minute, and minutes that were under the digits subdir to be under the root of
sounds instead. Which is where the sounds will be for some languages after 1.6
sounds and for all languages after a future release.

ASTERISK-25810 #close

Change-Id: I05d9d4bee6a7237030530a46e7eb3df15f13f702
Reported-by: Nicolas Riendeau
---
M main/say.c
1 file changed, 26 insertions(+), 26 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/6024/1

diff --git a/main/say.c b/main/say.c
index 44f55e2..c97dc9f 100644
--- a/main/say.c
+++ b/main/say.c
@@ -4441,9 +4441,9 @@
 				}
 				if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
 					if (tm.tm_min == 1) {
-						res = wait_file(chan, ints, "digits/minute", lang);
+						res = wait_file(chan, ints, "minute", lang);
 					} else {
-						res = wait_file(chan, ints, "digits/minutes", lang);
+						res = wait_file(chan, ints, "minutes", lang);
 					}
 				}
 				break;
@@ -4517,7 +4517,7 @@
 				if (!res) {
 					res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");
 					if (!res) {
-						res = wait_file(chan, ints, "digits/seconds", lang);
+						res = wait_file(chan, ints, "seconds", lang);
 					}
 				}
 				break;
@@ -4637,16 +4637,16 @@
 			case 'M':
 				/* Minute */
 				if (next_item(&format[offset + 1]) == 'S') { /* zero 'digits/0' only if seconds follow */
-					res = ast_say_number(chan, tm.tm_min, ints, lang, "f"); /* female only if we say digits/minutes */
+					res = ast_say_number(chan, tm.tm_min, ints, lang, "f"); /* female only if we say minutes */
 				} else if (tm.tm_min > 0) {
 					res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
 				}
 
 				if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
 					if (tm.tm_min == 1) {
-						res = wait_file(chan, ints, "digits/minute", lang);
+						res = wait_file(chan, ints, "minute", lang);
 					} else {
-						res = wait_file(chan, ints, "digits/minutes", lang);
+						res = wait_file(chan, ints, "minutes", lang);
 					}
 				}
 				break;
@@ -4720,7 +4720,7 @@
 				if (!res) {
 					res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");
 					if (!res) {
-						res = wait_file(chan, ints, tm.tm_sec == 1 ? "digits/second" : "digits/seconds", lang);
+						res = wait_file(chan, ints, tm.tm_sec == 1 ? "second" : "seconds", lang);
 					}
 				}
 				break;
@@ -4853,9 +4853,9 @@
 				if (!res && next_item(&format[offset + 1]) == 'S') { /* minutes only if seconds follow */
 					/* Say minute/minutes depending on whether minutes end in 1 */
 					if ((tm.tm_min % 10 == 1) && (tm.tm_min != 11)) {
-						res = wait_file(chan, ints, "digits/minute", lang);
+						res = wait_file(chan, ints, "minute", lang);
 					} else {
-						res = wait_file(chan, ints, "digits/minutes", lang);
+						res = wait_file(chan, ints, "minutes", lang);
 					}
 				}
 				break;
@@ -4930,9 +4930,9 @@
 					res = ast_say_number(chan, tm.tm_sec, ints, lang, "f");
 					/* Say minute/minutes depending on whether seconds end in 1 */
 					if (!res && (tm.tm_sec % 10 == 1) && (tm.tm_sec != 11)) {
-						res = wait_file(chan, ints, "digits/second", lang);
+						res = wait_file(chan, ints, "second", lang);
 					} else {
-						res = wait_file(chan, ints, "digits/seconds", lang);
+						res = wait_file(chan, ints, "seconds", lang);
 					}
 				}
 				break;
@@ -5652,7 +5652,7 @@
 				/* Seconds */
 				res = ast_say_number(chan, tm.tm_sec, ints, lang, (char * ) NULL);
 				if (!res) {
-					res = wait_file(chan, ints, "digits/second", lang);
+					res = wait_file(chan, ints, "second", lang);
 				}
 				break;
 			case 'T':
@@ -6303,9 +6303,9 @@
 							one = tm.tm_sec % 10;
 
 							if (one > 1 && one < 5 && ten != 1)
-								res = wait_file(chan, ints, "digits/seconds", lang);
+								res = wait_file(chan, ints, "seconds", lang);
 							else
-								res = wait_file(chan, ints, "digits/second", lang);
+								res = wait_file(chan, ints, "second", lang);
 						}
 					}
 				}
@@ -6469,9 +6469,9 @@
 					res = ast_say_number(chan, tm.tm_min, ints, lang, NULL);
 					if (!res) {
 						if (tm.tm_min > 1) {
-							res = wait_file(chan, ints, "digits/minutes", lang);
+							res = wait_file(chan, ints, "minutes", lang);
 						} else {
-							res = wait_file(chan, ints, "digits/minute", lang);
+							res = wait_file(chan, ints, "minute", lang);
 						}
 					}
 				} else {
@@ -6567,9 +6567,9 @@
 					res = ast_say_number(chan, tm.tm_sec, ints, lang, NULL);
 					if (!res) {
 						if (tm.tm_sec > 1) {
-							res = wait_file(chan, ints, "digits/seconds", lang);
+							res = wait_file(chan, ints, "seconds", lang);
 						} else {
-							res = wait_file(chan, ints, "digits/second", lang);
+							res = wait_file(chan, ints, "second", lang);
 						}
 					}
 				} else {
@@ -6783,7 +6783,7 @@
 					}
 				}
 				if (!res) {
-					res = wait_file(chan, ints, "digits/minute", lang);
+					res = wait_file(chan, ints, "minute", lang);
 				}
 				break;
 			case 'P':
@@ -6867,7 +6867,7 @@
 					}
 				}
 				if (!res) {
-					res = wait_file(chan, ints, "digits/second", lang);
+					res = wait_file(chan, ints, "second", lang);
 				}
 				break;
 			case 'T':
@@ -7022,7 +7022,7 @@
 	    if (tm.tm_min > 0) {
 			res = ast_say_number(chan, tm.tm_min, ints, lang, "f");
 			if (!res)
-				res = ast_streamfile(chan, "digits/minute", lang);
+				res = ast_streamfile(chan, "minute", lang);
 		}
 	return res;
 }
@@ -7117,9 +7117,9 @@
 			res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
 		if (!res) {
 			if (tm.tm_min > 1)
-				res = wait_file(chan, ints, "digits/minutes", lang);
+				res = wait_file(chan, ints, "minutes", lang);
 			else
-				res = wait_file(chan, ints, "digits/minute", lang);
+				res = wait_file(chan, ints, "minute", lang);
 		}
 	}
 	return res;
@@ -7179,7 +7179,7 @@
 	if (!res)
 		res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
 	if (!res)
-		res = ast_streamfile(chan, "digits/minute", lang);
+		res = ast_streamfile(chan, "minute", lang);
 	if (!res)
 		res = ast_waitstream(chan, ints);
 	return res;
@@ -7602,7 +7602,7 @@
 	if (!res)
 		res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
 	if (!res)
-		res = ast_streamfile(chan, "digits/minute", lang);
+		res = ast_streamfile(chan, "minute", lang);
 	if (!res)
 		res = ast_waitstream(chan, ints);
 	return res;
@@ -8480,7 +8480,7 @@
 			if (!res)
 				res = ast_say_number_full_gr(chan, tm.tm_sec, ints, lang, -1, -1);
 			if (!res)
-				ast_copy_string(nextmsg, "digits/seconds", sizeof(nextmsg));
+				ast_copy_string(nextmsg, "seconds", sizeof(nextmsg));
 			res = wait_file(chan, ints, nextmsg, lang);
 			break;
 		case 'T':

-- 
To view, visit https://gerrit.asterisk.org/6024
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I05d9d4bee6a7237030530a46e7eb3df15f13f702
Gerrit-Change-Number: 6024
Gerrit-PatchSet: 1
Gerrit-Owner: Rusty Newton <rnewton at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170714/caaf3366/attachment-0001.html>


More information about the asterisk-code-review mailing list