Summary: | ASTERISK-29695: SAY.CONF wrong logic when converting 24hour time to say 12 hour am/pm | ||||||
Reporter: | Vincent Dubois (vdubois-b2b2c) | Labels: | |||||
Date Opened: | 2021-10-19 08:46:55 | Date Closed: | 2022-01-05 14:17:23.000-0600 | ||||
Priority: | Minor | Regression? | |||||
Status: | Closed/Complete | Components: | Applications/app_voicemail | ||||
Versions: | 16.16.0 | Frequency of Occurrence | Constant | ||||
Related Issues: |
| ||||||
Environment: | Doesn't matter, and from what I can see all version are affected | Attachments: | |||||
Description: | 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. | ||||||
Comments: | By: Asterisk Team (asteriskteam) 2021-10-19 08:46:57.264-0500 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur. Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/]. By: Benjamin Keith Ford (bford) 2021-10-19 11:34:01.253-0500 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 By: Vincent Dubois (vdubois-b2b2c) 2021-10-19 12:38:18.256-0500 I have no idea how to submit a patch, and really do not have time to look it all up. So if you can do it, go ahead. I just wanted to point out the issue, and hopefully someone else will do the leg work of patching it :-) By: Friendly Automation (friendly-automation) 2022-01-05 14:17:24.548-0600 Change 17651 merged by Friendly Automation: say.conf: fix 12pm noon logic [https://gerrit.asterisk.org/c/asterisk/+/17651|https://gerrit.asterisk.org/c/asterisk/+/17651] By: Friendly Automation (friendly-automation) 2022-01-05 14:17:29.497-0600 Change 17834 merged by Friendly Automation: say.conf: fix 12pm noon logic [https://gerrit.asterisk.org/c/asterisk/+/17834|https://gerrit.asterisk.org/c/asterisk/+/17834] By: Friendly Automation (friendly-automation) 2022-01-06 05:49:47.462-0600 Change 17833 merged by Joshua Colp: say.conf: fix 12pm noon logic [https://gerrit.asterisk.org/c/asterisk/+/17833|https://gerrit.asterisk.org/c/asterisk/+/17833] By: Friendly Automation (friendly-automation) 2022-01-06 05:49:56.316-0600 Change 17832 merged by Joshua Colp: say.conf: fix 12pm noon logic [https://gerrit.asterisk.org/c/asterisk/+/17832|https://gerrit.asterisk.org/c/asterisk/+/17832] |