Fix hours 21-23 (bug #592)
authorMark Spencer <markster@digium.com>
Mon, 8 Dec 2003 05:24:28 +0000 (05:24 +0000)
committerMark Spencer <markster@digium.com>
Mon, 8 Dec 2003 05:24:28 +0000 (05:24 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1838 65c4cc65-6c06-0410-ace0-fbb531ad65f3

say.c

diff --git a/say.c b/say.c
index 6ded0ab..55f477d 100755 (executable)
--- a/say.c
+++ b/say.c
@@ -378,8 +378,15 @@ int ast_say_date_with_format(struct ast_channel *chan, time_t time, char *ints,
                                }
                                if (!res) {
                                        if (tm.tm_hour != 0) {
-                                               snprintf(nextmsg,sizeof(nextmsg), AST_SOUNDS "/digits/%d", tm.tm_hour);
-                                               res = wait_file(chan,ints,nextmsg,lang);
+                                               int remainder = tm.tm_hour;
+                                               if (tm.tm_hour > 20) {
+                                                       res = wait_file(chan,ints,AST_SOUNDS "/digits/20",lang);
+                                                       remainder -= 20;
+                                               }
+                                               if (!res) {
+                                                       snprintf(nextmsg,sizeof(nextmsg), AST_SOUNDS "/digits/%d", remainder);
+                                                       res = wait_file(chan,ints,nextmsg,lang);
+                                               }
                                        }
                                }
                                break;