mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-04 09:44:26 +00:00
FS-10058: [mod_voicemail] voicemail timestamp plays in military time #resolve
FS-10058: [mod_voicemail] voicemail timestamp plays in military time
This commit is contained in:
parent
ad08fa13b6
commit
072797c0c1
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user