CDR_TDS Tries To Write To Ends Column Instead Of End

Home » Asterisk Users » CDR_TDS Tries To Write To Ends Column Instead Of End
Asterisk Users 1 Comment

Hi all

I’m trying to get Asterisk 1.8.11.0 to write to the ast_cdr table on an MSSQL instance.

My problem is that the cdr_tds module insists on naming the end column as
“ends” – it tries to write to this column, which does not exist.

I get this in the CLI:

[Dec 23 09:25:17] NOTICE[2545]: cdr_tds.c:476 tds_message_handler: Invalid column name ‘ends’.
[Dec 23 09:25:17] ERROR[2545]: cdr_tds.c:464 tds_error_handler: General SQL
Server error: Check messages from the SQL Server (207)
[Dec 23 09:25:17] NOTICE[2545]: cdr_tds.c:476 tds_message_handler: Invalid column name ‘ends’.
[Dec 23 09:25:17] ERROR[2545]: cdr_tds.c:464 tds_error_handler: General SQL
Server error: Check messages from the SQL Server (207)
[Dec 23 09:25:17] NOTICE[2545]: cdr_tds.c:266 tds_log: Failed to execute INSERT statement, retrying…

I executed this (as indicated in cdr_tds.c) to create the table:

CREATE TABLE [dbo].[cdr] (
[accountcode] [varchar] (20) NULL ,
[src] [varchar] (80) NULL ,
[dst] [varchar] (80) NULL ,
[dcontext] [varchar] (80) NULL ,
[clid] [varchar] (80) NULL ,
[channel] [varchar] (80) NULL ,
[dstchannel] [varchar] (80) NULL ,
[lastapp] [varchar] (80) NULL ,
[lastdata] [varchar] (80) NULL ,
[start] [datetime] NULL ,
[answer] [datetime] NULL ,
[end] [datetime] NULL ,
[duration] [int] NULL ,
[billsec] [int] NULL ,
[disposition] [varchar] (20) NULL ,
[amaflags] [varchar] (16) NULL ,
[uniqueid] [varchar] (32) NULL ,
[userfield] [varchar] (256) NULL
) ON [PRIMARY]

So it definitely exists as “end” -NOT- “ends” – how can I get Asterisk to write to just “end” as it is supposed to? For end time for the CDR?

Thanks

Stefan

One thought on - CDR_TDS Tries To Write To Ends Column Instead Of End

  • Hi all

    Managed to solve this. It wasn’t Asterisk’s fault, I had a trigger on the ast_cdr table which was referrening to another table in my DB having an
    “ends” column, when it should have been “end”.

    cdr_tds was literally just passing along the error it got from “deeper” in the MSSQL table structure I’m using with Asterisk.

    Sorry for the bother… all’s fine now.

    Kind regards

    Stefan