[Home]

Summary:ASTERISK-27830: Asterisk crashes on Invalid UTF-8 string
Reporter:AvayaXAsterisk (avayax)Labels:
Date Opened:2018-04-30 16:30:37Date Closed:2023-03-01 14:27:45.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:13.18.4 18.16.0 20.1.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:This is happening on a FreePBX system, but as it's an Asterisk issue I am posting it here. In FreePBX I have a ring group configured that initiates nine outbound call legs. Calls come in over a Digium PRI gateway which inserts an invalid UTF-8 string "▒" in front of the Caller ID name, e.g. '▒2126564615', which crashes Asterisk.
I am getting below error/backtrace on all of the outbound call legs Asterisk wants to initiate and then Asterisk crashes with
"Disconnected from Asterisk server
Asterisk cleanly ending (0)":

Got 22 backtrace records
#0: [0x5394a7] asterisk ast_json_vpack() (0x5393d8+CF)
#1: [0x5393c8] asterisk ast_json_pack() (0x539305+C3)
#2: [0x7f816e95d41d] res_agi.so <unknown>()
#3: [0x7f816e95dfe6] res_agi.so <unknown>()
#4: [0x7f816e95f47a] res_agi.so <unknown>()
#5: [0x7f816e95f5c1] res_agi.so <unknown>()
#6: [0x58ba78] asterisk pbx_exec() (0x58b943+135)
#7: [0x57836c] asterisk <unknown>()
#8: [0x57ba41] asterisk ast_spawn_extension() (0x57b9dc+65)
#9: [0x7f8111efd26f] app_macro.so <unknown>()
#10: [0x7f8111efe603] app_macro.so <unknown>()
#11: [0x58ba78] asterisk pbx_exec() (0x58b943+135)
#12: [0x57836c] asterisk <unknown>()
#13: [0x57ba41] asterisk ast_spawn_extension() (0x57b9dc+65)
#14: [0x57c84f] asterisk <unknown>()
#15: [0x57e27e] asterisk <unknown>()
#16: [0x606624] asterisk <unknown>()
   -- Executing [s@macro-dial:16] ExecIf("Local/RG-4444-2017#@from-internal-00000005;2", "0?Set(HASH(__SIPHEADERS,Alert-Info)=Normal;volume=)") in new stack
dialparties.agi: Caller ID name is '▒2126564615' number is '2126564615'
[2018-04-28 03:45:50] ERROR[48107][C-00000001]: json.c:825 ast_json_vpack: Error building JSON from '{s: i, s: s, s: i, s: s}': Invalid UTF-8 string.
   -- Executing [s@macro-dial:17] ExecIf("Local/RG-4444-2017#@from-internal-00000005;2", "0?Set(HASH(__SIPHEADERS,Alert-Info)=Normal;volume=)") in new stack
   -- Executing [s@macro-dial:18] Set("Local/RG-4444-2017#@from-internal-00000005;2", "ITER=2") in new stack
   -- Executing [s@macro-dial:19] GotoIf("Local/RG-4444-2017#@from-internal-00000005;2", "0?ndloopbegin") in new stack
freepbx-a*CLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups
Comments:By: Asterisk Team (asteriskteam) 2018-04-30 16:30:38.750-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.

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].

By: George Joseph (gjoseph) 2018-05-01 10:33:42.587-0500

Can we get more info?

* First, when asterisk crashes, we absolutely need the backtrace\[1\].
* Can you confirm that the PRI is attached to the gateway and the gateway is sending SIP to asterisk?
* Can you start a wireshark/tcpdump capture so we can see the SIP exchange between the gateway and asterisk?

\[1\]: https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

By: Asterisk Team (asteriskteam) 2018-05-15 12:00:01.331-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

By: Friendly Automation (friendly-automation) 2023-03-01 14:27:46.006-0600

Change 19946 merged by Friendly Automation:
res_pjsip: Replace invalid UTF-8 sequences in callerid name

[https://gerrit.asterisk.org/c/asterisk/+/19946|https://gerrit.asterisk.org/c/asterisk/+/19946]

By: Friendly Automation (friendly-automation) 2023-03-01 14:28:44.745-0600

Change 19945 merged by Friendly Automation:
res_pjsip: Replace invalid UTF-8 sequences in callerid name

[https://gerrit.asterisk.org/c/asterisk/+/19945|https://gerrit.asterisk.org/c/asterisk/+/19945]

By: Friendly Automation (friendly-automation) 2023-03-02 08:21:42.593-0600

Change 19898 merged by Joshua Colp:
res_pjsip: Replace invalid UTF-8 sequences in callerid name

[https://gerrit.asterisk.org/c/asterisk/+/19898|https://gerrit.asterisk.org/c/asterisk/+/19898]