Summary: | ASTERISK-30248: ast_get_digit_str adds bogus initial delimiter if first character not to be spoken | ||||||||
Reporter: | David Woolley (david55) | Labels: | |||||||
Date Opened: | 2022-09-27 16:39:41 | Date Closed: | 2022-10-26 09:00:46 | ||||||
Priority: | Minor | Regression? | |||||||
Status: | Closed/Complete | Components: | Applications/app_saynumber Applications/app_voicemail | ||||||
Versions: | GIT 16.28.0 | Frequency of Occurrence | Constant | ||||||
Related Issues: |
| ||||||||
Environment: | Observed by third party on FreePBX 15.0.23.25, when trying to speak envelope with caller ID beginning with +, but diagnosed from github source code. | Attachments: | |||||||
Description: | ast_get_digit_str() is used to construct a playback type filename sequence for speaking the digits of a number. It tries to produce an & delimited string, with no initial &. To decide whether to suppress the initial & it checks the index into the source array for zero. However, if the first input character is not one it understands, the first output file name doesn't correspond to input character 0, and so does get an & prefix, This gets parsed as an empty file name in subsequent processing, which in the specific case where this was found caused the voicemail processing to abort at the point in announcing the envelope where it would have given the caller ID.
It appears to me that the same problem exists in at least ast_get_phonetic_str, and ast_get_character_str as well. I'm retired myself, and don't have an Asterisk development and test environment to hand, any longer, so I'll just describe my suggested fix, rather than providing a patch. My suggestion is to replace (num == 0 ? "%s" : "&%s") in the ast_str_append call with a const char * variable that is intialised to "%s", and changed to "&%s" after a file name is successfully added. The problem can be avoided by replacing the + with the actual digits it represents. | ||||||||
Comments: | By: Asterisk Team (asteriskteam) 2022-09-27 16:39:48.500-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: Joshua C. Colp (jcolp) 2022-09-27 17:12:00.827-0500 I think this is a regression introduced by ASTERISK-29531. By: Joshua C. Colp (jcolp) 2022-09-27 17:12:58.052-0500 [~InterLinked] Will you look at this since it seems like you introduced it? By: Friendly Automation (friendly-automation) 2022-10-26 09:00:48.861-0500 Change 19482 merged by Friendly Automation: say: Don't prepend ampersand erroneously. [https://gerrit.asterisk.org/c/asterisk/+/19482|https://gerrit.asterisk.org/c/asterisk/+/19482] By: Friendly Automation (friendly-automation) 2022-10-26 09:01:19.065-0500 Change 19483 merged by Friendly Automation: say: Don't prepend ampersand erroneously. [https://gerrit.asterisk.org/c/asterisk/+/19483|https://gerrit.asterisk.org/c/asterisk/+/19483] By: Friendly Automation (friendly-automation) 2022-10-26 09:52:41.606-0500 Change 19316 merged by Friendly Automation: say: Don't prepend ampersand erroneously. [https://gerrit.asterisk.org/c/asterisk/+/19316|https://gerrit.asterisk.org/c/asterisk/+/19316] By: Friendly Automation (friendly-automation) 2022-10-26 10:07:25.784-0500 Change 19481 merged by George Joseph: say: Don't prepend ampersand erroneously. [https://gerrit.asterisk.org/c/asterisk/+/19481|https://gerrit.asterisk.org/c/asterisk/+/19481] By: Friendly Automation (friendly-automation) 2023-01-04 06:01:42.997-0600 Change 19812 merged by Friendly Automation: say: Don't prepend ampersand erroneously. [https://gerrit.asterisk.org/c/asterisk/+/19812|https://gerrit.asterisk.org/c/asterisk/+/19812] By: Friendly Automation (friendly-automation) 2023-01-04 06:38:26.970-0600 Change 19813 merged by George Joseph: say: Don't prepend ampersand erroneously. [https://gerrit.asterisk.org/c/asterisk/+/19813|https://gerrit.asterisk.org/c/asterisk/+/19813] |