[asterisk-bugs] [JIRA] (ASTERISK-30248) ast_get_digit_str adds bogus initial delimiter if first character not to be spoken

Friendly Automation (JIRA) noreply at issues.asterisk.org
Wed Jan 4 06:40:03 CST 2023


    [ https://issues.asterisk.org/jira/browse/ASTERISK-30248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=261128#comment-261128 ] 

Friendly Automation commented on ASTERISK-30248:
------------------------------------------------

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]

> ast_get_digit_str adds bogus initial delimiter if first character not to be spoken
> ----------------------------------------------------------------------------------
>
>                 Key: ASTERISK-30248
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30248
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_saynumber, Applications/app_voicemail
>    Affects Versions: GIT, 16.28.0
>         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.
>            Reporter: David Woolley
>            Assignee: N A
>      Target Release: 18.16.0, 19.8.0, 20.1.0
>
>
> 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.



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



More information about the asterisk-bugs mailing list