From 072797c0c1145a334cd7de97bf0e9dd978081892 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 20 Feb 2017 17:30:28 -0600 Subject: [PATCH] FS-10058: [mod_voicemail] voicemail timestamp plays in military time #resolve FS-10058: [mod_voicemail] voicemail timestamp plays in military time --- src/mod/say/mod_say_en/mod_say_en.c | 33 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/mod/say/mod_say_en/mod_say_en.c b/src/mod/say/mod_say_en/mod_say_en.c index e3c9bdd652..55ab0de69f 100644 --- a/src/mod/say/mod_say_en/mod_say_en.c +++ b/src/mod/say/mod_say_en/mod_say_en.c @@ -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) {