say minutes/seconds using existing 'say number' code for Danish (issue #5277)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent 626582a84c
commit bc596e3543

32
say.c

@ -3105,22 +3105,8 @@ int ast_say_date_with_format_en(struct ast_channel *chan, time_t time, const cha
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min); snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min);
res = wait_file(chan,ints,nextmsg,lang); res = wait_file(chan,ints,nextmsg,lang);
} }
} else if ((tm.tm_min < 21) || (tm.tm_min % 10 == 0)) {
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_min);
res = wait_file(chan,ints,nextmsg,lang);
} else { } else {
int ten, one; res = ast_say_number(chan, tm.tm_min, ints, lang, (char *) NULL);
ten = (tm.tm_min / 10) * 10;
one = (tm.tm_min % 10);
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten);
res = wait_file(chan,ints,nextmsg,lang);
if (!res) {
/* Fifty, not fifty-zero */
if (one != 0) {
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
res = wait_file(chan,ints,nextmsg,lang);
}
}
} }
break; break;
case 'P': case 'P':
@ -3194,22 +3180,8 @@ int ast_say_date_with_format_en(struct ast_channel *chan, time_t time, const cha
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec); snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
res = wait_file(chan,ints,nextmsg,lang); res = wait_file(chan,ints,nextmsg,lang);
} }
} else if ((tm.tm_sec < 21) || (tm.tm_sec % 10 == 0)) {
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_sec);
res = wait_file(chan,ints,nextmsg,lang);
} else { } else {
int ten, one; res = ast_say_number(chan, tm.tm_sec, ints, lang, (char *) NULL);
ten = (tm.tm_sec / 10) * 10;
one = (tm.tm_sec % 10);
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", ten);
res = wait_file(chan,ints,nextmsg,lang);
if (!res) {
/* Fifty, not fifty-zero */
if (one != 0) {
snprintf(nextmsg,sizeof(nextmsg), "digits/%d", one);
res = wait_file(chan,ints,nextmsg,lang);
}
}
} }
break; break;
case 'T': case 'T':

Loading…
Cancel
Save