mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
add the saying of seconds
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
32
say.c
32
say.c
@@ -478,6 +478,38 @@ int ast_say_date_with_format(struct ast_channel *chan, time_t time, char *ints,
|
|||||||
case 'R':
|
case 'R':
|
||||||
res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
|
res = ast_say_date_with_format(chan, time, ints, lang, "HM", timezone);
|
||||||
break;
|
break;
|
||||||
|
case 'S':
|
||||||
|
/* Seconds */
|
||||||
|
if (tm.tm_sec == 0) {
|
||||||
|
snprintf(nextmsg,sizeof(nextmsg),DIGITS_DIR "%d", tm.tm_sec);
|
||||||
|
res = wait_file(chan,ints,nextmsg,lang);
|
||||||
|
} else if (tm.tm_sec < 10) {
|
||||||
|
res = wait_file(chan,ints,DIGITS_DIR "oh",lang);
|
||||||
|
if (!res) {
|
||||||
|
snprintf(nextmsg,sizeof(nextmsg),DIGITS_DIR "%d", tm.tm_sec);
|
||||||
|
res = wait_file(chan,ints,nextmsg,lang);
|
||||||
|
}
|
||||||
|
} else if ((tm.tm_sec < 21) || (tm.tm_sec % 10 == 0)) {
|
||||||
|
snprintf(nextmsg,sizeof(nextmsg),DIGITS_DIR "%d", tm.tm_sec);
|
||||||
|
res = wait_file(chan,ints,nextmsg,lang);
|
||||||
|
} else {
|
||||||
|
int ten, one;
|
||||||
|
ten = (tm.tm_sec / 10) * 10;
|
||||||
|
one = (tm.tm_sec % 10);
|
||||||
|
snprintf(nextmsg,sizeof(nextmsg),DIGITS_DIR "%d", ten);
|
||||||
|
res = wait_file(chan,ints,nextmsg,lang);
|
||||||
|
if (!res) {
|
||||||
|
/* Fifty, not fifty-zero */
|
||||||
|
if (one != 0) {
|
||||||
|
snprintf(nextmsg,sizeof(nextmsg),DIGITS_DIR "%d", one);
|
||||||
|
res = wait_file(chan,ints,nextmsg,lang);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'T':
|
||||||
|
res = ast_say_date_with_format(chan, time, ints, lang, "HMS", timezone);
|
||||||
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
case ' ':
|
case ' ':
|
||||||
/* Just ignore spaces and tabs */
|
/* Just ignore spaces and tabs */
|
||||||
|
Reference in New Issue
Block a user