]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10058: [mod_voicemail] voicemail timestamp plays in military time #resolve
authorBrian West <brian@freeswitch.org>
Mon, 20 Feb 2017 23:30:28 +0000 (17:30 -0600)
committerMike Jerris <mike@jerris.com>
Tue, 7 Mar 2017 19:40:57 +0000 (13:40 -0600)
FS-10058: [mod_voicemail] voicemail timestamp plays in military time

src/mod/say/mod_say_en/mod_say_en.c

index e3c9bdd6526a36307b56bb1e65245010fc48501b..55ab0de69f1c8ac0014355503a562e10c8706225 100644 (file)
@@ -381,7 +381,7 @@ static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, sw
        }
 
        if (say_time) {
-               int32_t hour = tm.tm_hour, pm = 0, mil = 0;
+               int32_t hour = tm.tm_hour, mil = 0;
 
                if (say_args->method == SSM_ITERATED) {
                        mil = 1;
@@ -391,23 +391,12 @@ static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, sw
                        switch_say_file(sh, "time/at");
                }
 
-               if (hour > 12) {
-                       mil++;
-               } else if (hour == 12) {
-                       pm = 1;
-               } else if (hour == 0) {
-                       if (mil) {
-                               if (tm.tm_min == 0) {
-                                       hour = 24;
-                               }
-                       } else {
-                               hour = 12;
-                               pm = 0;
-                       }
-               }
-
                if (mil) {
 
+                       if (hour == 0 && tm.tm_min == 0) {
+                               hour = 24;
+                       }
+
                        if (hour < 10) {
                                say_num(sh, 0, SSM_PRONOUNCED);
                        }
@@ -426,6 +415,18 @@ static switch_status_t en_say_time(switch_say_file_handle_t *sh, char *tosay, sw
                        switch_say_file(sh, "time/hours");
 
                } else {
+                       switch_bool_t pm = 0;
+
+                       if (hour >= 12) {
+                               pm = 1;
+                       }
+
+                       if (hour > 12) {
+                               hour -= 12;
+                       } else if (hour == 0) {
+                               hour = 12;
+                       }
+
                        say_num(sh, hour, SSM_PRONOUNCED);
                        
                        if (tm.tm_min > 9) {