[asterisk-bugs] [JIRA] (ASTERISK-30500) Caller name corruption in encodings other than UTF-8

Sean Bright (JIRA) noreply at issues.asterisk.org
Tue Apr 25 14:05:03 CDT 2023


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

Sean Bright edited comment on ASTERISK-30500 at 4/25/23 2:03 PM:
-----------------------------------------------------------------

RFC 3261 mandates UTF-8, so there should be no need to try and guess the encoding.

Do you have a SIP proxy between the non-compliant devices and Asterisk that can translate from Windows-1251 to UTF-8? If you aren't able to get your vendor to fix the bug then that would be the next best place to fix this.

-Otherwise I agree we should just have a flag to disable it on a per endpoint basis.-

Edit: We actually can't have a flag to disable it on a per endpoint basis, it would have to be done globally (gross).


was (Author: seanbright):
RFC 3261 mandates UTF-8, so there should be no need to try and guess the encoding.

Do you have a SIP proxy between the non-compliant devices and Asterisk that can translate from Windows-1251 to UTF-8? If you aren't able to get your vendor to fix the bug then that would be the next best place to fix this.

Otherwise I agree we should just have a flag to disable it on a per endpoint basis.

> Caller name corruption in encodings other than UTF-8
> ----------------------------------------------------
>
>                 Key: ASTERISK-30500
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30500
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: 18.17.0
>         Environment: FreeBSD 13.2
>            Reporter: Basil Mi
>            Assignee: Unassigned
>            Severity: Major
>         Attachments: sip-capture.txt, win-1251_text_example_1.txt
>
>
> After this change:   ASTERISK-27830
> ===================================
> {quote}
> 2023-02-16 10:05 +0000 [1ddfb7551a]  George Joseph <gjoseph at sangoma.com>
>         * res_pjsip: Replace invalid UTF-8 sequences in callerid name
>            * Added a new function ast_utf8_replace_invalid_chars() to
>             utf8.c that copies a string replacing any invalid UTF-8
>             sequences with the Unicode specified U+FFFD replacement
>             character.  For example:  "abc\xffdef" becomes "abc\uFFFDdef".
>             Any UTF-8 compliant implementation will show that character
>             as a � character.
>            * Updated res_pjsip:set_id_from_hdr() to use
>             ast_utf8_replace_invalid_chars and print a warning if any
>             invalid sequences were found during the copy.
>            * Updated stasis_channels:ast_channel_publish_varset to use
>             ast_utf8_replace_invalid_chars and print a warning if any
>             invalid sequences were found during the copy.
>            ASTERISK-27830
> {quote}
> ===================================
> Some legacy devices transmit the caller name in encodings other than UTF-8. For example, PBX Panasonic KX-TDE600 uses WINDOWS-1251 and it's not configurable.
> In this case we use a function ICONV in dialplan to convert caller name to UTF-8 (for incoming calls). And vice versa (for outcoming calls).
> Using new function {color:red} "ast_utf8_replace_invalid_chars" {color} distorts caller name to "�" characters before it can be converted to UTF-8 in dialplan.
> Users see “�������” on devices instead of valid the caller's name.
> This logic worked for almost 10 years and broke on 18.17.0.
> Need to be able to turn off the replacement of invalid UTF-8 sequences (f.e. from config). Or  be able to use the ICONV before replacement (before call {color:red} "ast_utf8_replace_invalid_chars" {color}).



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



More information about the asterisk-bugs mailing list