[asterisk-bugs] [JIRA] (ASTERISK-29695) SAY.CONF wrong logic when converting 24hour time to say 12 hour am/pm

Benjamin Keith Ford (JIRA) noreply at issues.asterisk.org
Tue Oct 19 11:35:49 CDT 2021


     [ https://issues.asterisk.org/jira/browse/ASTERISK-29695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Keith Ford updated ASTERISK-29695:
-------------------------------------------

    Assignee: Vincent Dubois
      Status: Waiting for Feedback  (was: Triage)

Would you want to submit a patch to Gerrit\[1\] for this? Information on how to do so can be found on this wiki page\[2\].

\[1\]: https://gerrit.asterisk.org
\[2\]: https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage

> SAY.CONF wrong logic when converting 24hour time to say 12 hour am/pm
> ---------------------------------------------------------------------
>
>                 Key: ASTERISK-29695
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29695
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_voicemail
>    Affects Versions: 16.16.0
>         Environment: Doesn't matter, and from what I can see all version are affected
>            Reporter: Vincent Dubois
>            Assignee: Vincent Dubois
>
> in SAY.CONF there is 2 big logic errors:
> {noformat}
> _date:[I]:. => num:$[${SAY:8:2} % 12] ; hour 0-12
> {noformat}
> Modulo 12 will never return 12, but will return 0 at noon.
> Should be something like:
> {noformat}
> _date:[I]:. => num:${IF($[${SAY:8:2} > 12]?$[${SAY:8:2}-12]:${SAY:8:2})}
> {noformat}
> also:
> {noformat}
> _date:[pP]:. => digits/$[ ${SAY:8:2} > 12 ? "p-m" :: "a-m" ] ; am pm
> {noformat}
> this is wrong: midnight is 00, and noon is 12, and noon should be pm, so it should be
> {noformat}
> _date:[pP]:. => digits/$[ ${SAY:8:2} >= 12 ? "p-m" :: "a-m" ] ; am pm
> {noformat}
> I guess not many people are using this, because those error have been there for a very long time, I also have a super old 1.8.7 and it was already in it.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list