Hello, Is your userfield type varchar(255)?
Also check if you edited the cdr_addon_mysql.c and Make file to tell cdr_addon_mysql.c to store uniqueid as outlined here: http://www.voip-info.org/wiki-Asterisk+cdr+mysql cdr_addon_mysql.c: mysql_cdr: Failed to insert into database: (1062) Duplicate entry '' for key 1 This happens when you have UNIQUE for some field and insert same record twice. In order to help please paste your [cdr] table structure. I'm sure it's not a bug but misconfiguration which can be solved easily. Regards/Pagarbiai, Mindaugas Kezys http://www.kolmisoft.com VoIP Services&Solutions MOR - FREE Open Source billing for Asterisk -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Martin Sent: Monday, May 14, 2007 10:34 PM To: asterisk-users@lists.digium.com Subject: [asterisk-users] Some problems with mysql CDR Hello, We have finally upgraded to Asterisk 1.4, however we've run into two issues that weren't occurring before the upgrade. Issue #1: We're an outgoing call center and need to record all calls. We use the uniqueid field in the CDR to match with the recording, which we labeled with {UNIQUEID} in MixMonitor. For some reason, the uniqueid is not correct in the CDR. Here is the manager event for a call: Event: Cdr Privilege: call,all AccountCode: 6384106:MMI-Y:200705081051010077 Source: 0000000000 Destination: 6398714109927773 DestinationContext: outbound CallerID: 0000000000 Channel: Zap/15-1 DestinationChannel: SIP/teliax-081ed5b0 LastApplication: NoOp LastData: StartTime: 2007-05-08 10:51:04 AnswerTime: 2007-05-08 10:51:05 EndTime: 2007-05-08 11:01:56 Duration: 652 BillableSeconds: 651 Disposition: ANSWERED AMAFlags: DOCUMENTATION UniqueID: 1178635864.1510 UserField: And for that record in the database: 'calldate' '2007-05-08 10:51:04' 'clid' '0000000000' 'src' '0000000000' 'dst' '6398714109927773' 'dcontext' 'outbound' 'channel' 'Zap/15-1' 'dstchannel' 'SIP/teliax-081ed5b0' 'lastapp' 'NoOp' 'lastdata' '', 'duration' 652, 'billsec' 651, 'disposition' 'ANSWERED', 'amaflags' 3, 'accountcode' '6384106:MMI-Y:200705081051010077', 'uniqueid' '51010077', 'userfield' '', 'MMI_field' 'not found' Issue #2: When a call is not answered, a record of that call is written to the database, but uniqueid is left blank. The next time a call isn't answered, Asterisk complains: cdr_addon_mysql.c: mysql_cdr: Failed to insert into database: (1062) Duplicate entry '' for key 1 I haven't found any other information regarding these errors. I am just wondering if they are bugs. Any insight would be appreciated! -- Jason Martin Metrix Matrix, Inc. 785 Elmgrove Road, Building 1, Rochester, NY 14624 Office: 888-865-0065 Ext. 202 Mobile: (585) 721-8679 _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users