[asterisk-bugs] [Asterisk 0016655]: Double fields in SQL query

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Jan 23 06:32:27 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16655 
====================================================================== 
Reported By:                Yarik_rad
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16655
Category:                   CDR/cdr_pgsql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.0.21 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-01-20 04:48 CST
Last Modified:              2010-01-23 06:32 CST
====================================================================== 
Summary:                    Double fields in SQL query
Description: 
Try to connect Asterisk server with PostgreSQl database I've double fields
in SQL quere send to datbase.

Here is log of database server:

COMMAND:  INSERT INTO cdr
("calldate","clid","src","dst","dcontext","channel","dstchannel","lastapp","lastdata","duration","billsec","disposition","amaflags",
"uniqueid","calldate","clid","src","dst","dcontext","channel","dstchannel","lastapp","lastdata","duration","billsec","disposition","amaflags","uniqueid","calldate",
"clid","src","dst","dcontext","channel","dstchannel","lastapp","lastdata","duration","billsec","disposition","amaflags","accountcode","uniqueid","userfield",
"calldate","clid","src","dst","dcontext","channel","dstchannel","lastapp","lastdata","duration","billsec","disposition","amaflags","accountcode","uniqueid","userfield")
VALUES ('2010-01-20 13:43:16','"User714"
<714>','714','9060','kvartira','SIP/714-00000057','SIP/pstn-00000058','Dial','SIP/999060 at pstn',13,2,'ANSWERED',3,'1263984196.87',
'2010-01-20 13:43:16','"User714"
<714>','714','9060','kvartira','SIP/714-00000057','SIP/pstn-00000058','Dial','SIP/999060 at pstn',13,2,'ANSWERED',3,'1263984196.87',
'2010-01-20 13:43:16','"User714"
<714>','714','9060','kvartira','SIP/714-00000057','SIP/pstn-00000058','Dial','SIP/999060 at pstn',13,2,'ANSWERED',3,'','1263984196.87','',
'2010-01-20 13:43:16','"User714"
<714>','714','9060','kvartira','SIP/714-00000057','SIP/pstn-00000058','Dial','SIP/999060 at pstn',13,2,'ANSWERED',3,'','1263984196.87','')



====================================================================== 

---------------------------------------------------------------------- 
 (0117106) Yarik_rad (reporter) - 2010-01-23 06:32
 https://issues.asterisk.org/view.php?id=16655#c117106 
---------------------------------------------------------------------- 
I'm trying put CDR data information into PostgreSQL database. I use
cdr_pgsql.
So I got this log information in asterisk:
[Jan 23 15:28:34] ERROR[28400]: cdr_pgsql.c:309 pgsql_log: cdr_pgsql:
Failed to insert call detail record into database!
[Jan 23 15:28:34] ERROR[28400]: cdr_pgsql.c:310 pgsql_log: cdr_pgsql:
Reason: ERROR:  column "calldate" specified more than once
LINE 1:
...","amaflags","accountcode","uniqueid","userfield","calldate"...
                                                             ^

[Jan 23 15:28:34] ERROR[28400]: cdr_pgsql.c:311 pgsql_log: cdr_pgsql:
Connection may have been lost... attempting to reconnect.
[Jan 23 15:28:34] ERROR[28400]: cdr_pgsql.c:314 pgsql_log: cdr_pgsql:
Connection reestablished.
[Jan 23 15:28:34] ERROR[28400]: cdr_pgsql.c:320 pgsql_log: cdr_pgsql: HARD
ERROR!  Attempted reconnection failed.  DROPPING CALL RECORD!
[Jan 23 15:28:34] ERROR[28400]: cdr_pgsql.c:321 pgsql_log: cdr_pgsql:
Reason: ERROR:  column "calldate" specified more than once
LINE 1:
...","amaflags","accountcode","uniqueid","userfield","calldate"...
                                                             ^
In database log file I got this:
ERROR:  column "calldate" specified more than once at character 186
STATEMENT:  INSERT INTO cdr
("calldate","clid","src","dst","dcontext","channel",
"dstchannel","lastapp","lastdata","duration","billsec","disposition","amaflags",
"accountcode","uniqueid","userfield","calldate","clid","src","dst","dcontext",
"channel","dstchannel","lastapp","lastdata","duration","billsec",
"disposition","amaflags","uniqueid") VALUES ('2010-01-23
15:28:20','"User714" <714>','714','9060','kvartira',
'SIP/714-0000000f','SIP/pstn-00000010','Dial','SIP/999060 at pstn',14,6,'ANSWERED',3,'','1264249700.15','
','2010-01-23 15:28:20','"User714"
<714>','714','9060','kvartira','SIP/714-0000000f','SIP/pstn-00000010',
'Dial','SIP/999060 at pstn',14,6,'ANSWERED',3,'1264249700.15')

PostgreSQL is 8.3. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-23 06:32 Yarik_rad      Note Added: 0117106                          
======================================================================




More information about the asterisk-bugs mailing list