[Home]

Summary:ASTERISK-24053: CLONE - Problem inserting CEL records when certain characters are used
Reporter:Krzysztof Chmielewski (kristoff)Labels:
Date Opened:2014-07-17 09:14:48Date Closed:2014-07-17 09:15:20
Priority:MajorRegression?No
Status:Closed/CompleteComponents:CEL/cel_odbc Resources/res_odbc
Versions:1.8.19.1 1.8.26.1 Frequency of
Occurrence
Constant
Related
Issues:
is the original version of this clone:ASTERISK-23594 Problem inserting CEL records when certain characters are used
Environment:Attachments:
Description:Hello,
we noticed encoding error in Asterisk logs every time when our asterisk receives SIP packet with polish special sign.

The error is:
{code}
[2014-04-04 08:29:26] NOTICE[5630] res_odbc.c: res_odbc: Connected to asterisk [postgresql]
[2014-04-04 08:29:26] WARNING[5630] res_odbc.c: SQL Execute returned an error -1: HY000: ERROR:  invalid byte sequence for encoding "UTF8": 0xb3;
Error while executing the query (88)
[2014-04-04 08:29:26] WARNING[5630] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [postgresql]...
[2014-04-04 08:29:26] WARNING[5630] res_odbc.c: Connection is down attempting to reconnect...
[2014-04-04 08:29:26] DEBUG[5630] res_odbc.c: Disconnected 0 from asterisk [postgresql]
[2014-04-04 08:29:26] DEBUG[5630] res_odbc.c: Database handle 0xb43d2aa8 deallocated
[2014-04-04 08:29:26] NOTICE[5630] res_odbc.c: Connecting asterisk
[2014-04-04 08:29:26] NOTICE[5630] res_odbc.c: res_odbc: Connected to asterisk [postgresql]
[2014-04-04 08:29:26] WARNING[5630] cel_odbc.c: Insert failed on 'asterisk:cel'.  CEL failed: INSERT INTO cel (eventtype,eventtime,userdeftype,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,amaflags,accountcode,peeraccount,uniqueid,linkedid,userfield,peer,extra,cel_state,queueinfo,sipcallid,rtpqos,preuid,preprocessexten) VALUES ('CHAN_START',{ ts '2014-04-04 08:29:26' },'','Rafał Gawra','rgawra','','','','932','CALLEX','SIP/rgawra-000075dd','',3,'rgawra','rgawra','1396592966.35521','1396592966.35521','','','','','','','','','')
{code}

Problem consider the cel_odbc mechanism - we are using CEL mechanism and cel_odbc. Asterisk is trying to insert CHAN_START event to our Postgresql database with CID value "Rafał Gawra" Letter "ł" seams as a problem here.

Our Postgresql database is in UTF-8 coding and in /etc/locale.gen file (we are using Debian OS) we have:

{code}
en_US.UTF-8 UTF-8
pl_PL ISO-8859-2
pl_PL.UTF-8 UTF-8
{code}

We noticed that Asterisk can crash from this error when system is under bigger load and this error occurred couple of times at the same time.

Problem seams to be similar to ASTERISK-15724 (problem with cdr_pgsql )

Problem is very easy to reproduce. You just need to send SIP Packet (invite) with polish sign in FROM or TO header.
Comments: