[asterisk-bugs] [Asterisk 0016940]: [patch] Problem inserting CDR records when certain characters are used

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 22 07:14:32 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16940 
====================================================================== 
Reported By:                jamicque
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   16940
Category:                   CDR/cdr_pgsql
Reproducibility:            have not tried
Severity:                   major
Priority:                   normal
Status:                     ready for testing
Target Version:             1.6.2.15
Asterisk Version:           SVN 
JIRA:                       SWP-988 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-01 15:41 CST
Last Modified:              2010-09-22 07:14 CDT
====================================================================== 
Summary:                    [patch] Problem inserting CDR records when certain
characters are used
Description: 
Hi, 1 on every 20 CDRs ends like lob below:

[Mar  1 19:35:00] VERBOSE[25629] cdr_pgsql.c:        > [INSERT INTO cdr
("calldate","clid","src","dst","dcontext","channel","dstchannel","lastapp","lastdata","duration","billsec
","disposition","amaflags","accountcode","uniqueid","userfield") VALUES
('2010-03-01 19:34:15','"+48514549083"
<514549083>','514549083','metalzbyt','CALLEX','SIP/metalzbyt-00000
843','Local/slawomir_plata at CALLEX-f2ea;1','AGI','HANGUP',45,0,'NO
ANSWER',3,'metalzbyt','1267468455.4476','A:+48514549083;SI:SIP/FreeconNet;B:+48586863734;DI:CALLEX/Ko?cierzyna;
')]
[Mar  1 19:35:00] DEBUG[25631] pbx.c: Function result is
'A:+48514549083;SI:SIP/FreeconNet;B:sabina_armatowska|sabina_armatowska|sabina_armatowska;DI:CALLEX/sabina_armatowska;'
[Mar  1 19:35:00] DEBUG[25629] cdr_pgsql.c: inserting a CDR record.
[Mar  1 19:35:00] DEBUG[19732] devicestate.c: No provider found, checking
channel drivers for Local - sabina_armatowska at CALLEX
[Mar  1 19:35:00] ERROR[25629] cdr_pgsql.c: Failed to insert call detail
record into database!
[Mar  1 19:35:00] ERROR[25629] cdr_pgsql.c: Reason: ERROR:  invalid byte
sequence for encoding "UTF8": 0xb6
HINT:  This error can also happen if the byte sequence does not match the
encoding expected by the server, which is controlled by "client_encoding".

[Mar  1 19:35:00] DEBUG[19732] chan_local.c: Checking if extension
sabina_armatowska at CALLEX exists (devicestate)
[Mar  1 19:35:00] ERROR[25629] cdr_pgsql.c: Connection may have been
lost... attempting to reconnect.
[Mar  1 19:35:00] DEBUG[19732] devicestate.c: Changing state for
Local/sabina_armatowska at CALLEX - state 1 (Not in use)
[Mar  1 19:35:00] DEBUG[19732] devicestate.c: device
'Local/sabina_armatowska at CALLEX' state '1'
[Mar  1 19:35:00] DEBUG[19740] app_queue.c: Device
'Local/sabina_armatowska at CALLEX' changed to state '1' (Not in use) but we
don't care because they're not a member of any queue
.
[Mar  1 19:35:00] ERROR[25629] cdr_pgsql.c: Connection reestablished.
[Mar  1 19:35:00] ERROR[25629] cdr_pgsql.c: HARD ERROR!  Attempted
reconnection failed.  DROPPING CALL RECORD!
[Mar  1 19:35:00] ERROR[25629] cdr_pgsql.c: Reason: ERROR:  invalid byte
sequence for encoding "UTF8": 0xb6
HINT:  This error can also happen if the byte sequence does not match the
encoding expected by the server, which is controlled by "client_encoding".


I've tried to insert CDR manually and it worked fine. I guess that there
can be something wrong with cdr_pgsql.

My database is in utf-8.
====================================================================== 

---------------------------------------------------------------------- 
 (0127272) jamicque (reporter) - 2010-09-22 07:14
 https://issues.asterisk.org/view.php?id=16940#c127272 
---------------------------------------------------------------------- 
I confirm, the patch fixed the problem, the crash no longer occurs. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-09-22 07:14 jamicque       Note Added: 0127272                          
======================================================================




More information about the asterisk-bugs mailing list