[Home]

Summary:ASTERISK-23162: SQLite3 CDRs are not being populated with CDR variables
Reporter:Pavel Basov (Bearish)Labels:
Date Opened:2014-01-20 09:19:37.000-0600Date Closed:2014-01-31 09:26:52.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:CDR/cdr_sqlite3_custom
Versions:12.0.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 6Attachments:
Description:cdr_sqlite3_custom.conf (deliberately simplified):

{noformat}
[master]
table=>cdr
columns=>calldate, clid, test
values=>'${CDR(start)}','${CDR(clid)}','test'
{noformat}

Resulting in database lacking CDR values:

{noformat}
sqlite> select * from cdr;
AcctId|calldate|clid|test
1|||test
2|||test
3|||test
4|||test
{noformat}

IDs are incementing, test value is there, but it doesn't want to grab CDR variables from
values=>'$\{CDR(start)\}','$\{CDR(clid)\}','test'
Comments:By: Matt Jordan (mjordan) 2014-01-20 10:36:40.300-0600

Hm... I think it may actually be your config.

I ran with the standard config file, plus a few extra fields:

{noformat}
[master]

table => cdr
columns => calldate, clid, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, test_caller, test_callee
values => '${CDR(start)}','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration)}','${CDR(billsec)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(test_caller)}','${CDR(test_callee)}'
{noformat}

This correctly inserts the values:

{noformat}
sqlite> select * from cdr;
1|2014-01-20 10:29:49|"Alice" <555-5555>|default|Local/target@default-00000001;2||NoOp||5|5|ANSWERED|DOCUMENTATION|foobar|1390235389.8|||
2|2014-01-20 10:29:49|"Alice" <555-5555>|default|Local/1000@default-00000000;2|Local/target@default-00000001;1|Dial|Local/target,,b(pre_dial^callee^1)B(pre_dial^caller^1)|5|5|ANSWERED|BILLING|foobar|1390235389.2|caller_userfield;callee_userfield|caller_value|callee_value
3|2014-01-20 10:29:54|"Alice" <555-5555>|default|Local/1000@default-00000000;2||NoOp||0|0|ANSWERED|BILLING|foobar|1390235389.2|caller_userfield|caller_value|
4|2014-01-20 10:29:49|"" <>|default|Local/1000@default-00000000;1||Echo||5|5|ANSWERED|BILLING|foobar|1390235389.0|||
sqlite>
{noformat}

Did you actually escape the paranthesis in your {{values}} field? If so, you shouldn't do that; it breaks the variable substitution, which would explain why you don't have any values showing up in your CDR.

By: Pavel Basov (Bearish) 2014-01-21 02:48:42.997-0600

No, i didn't escape parenths, it's just Jira is formatting them, and i didn't know about noformat.

Anyway, i've copypasted your config, and my database is still empty. What Sqlite3 version are you running? I have 3.6.20

By: Matt Jordan (mjordan) 2014-01-21 09:48:34.194-0600

3.7.9 here.

By: Matt Jordan (mjordan) 2014-01-31 09:26:43.213-0600

So, I'm unable to reproduce this problem using the latest from Asterisk 12 and {{cdr_sqlite3_custom.conf}}. At this point, I'm inclined to suspect that it is something in your SQLite3 schema and configuration file, as using the standard config and schema appears to be working fine. It also allows for custom values from the dialplan - so at this point, I'm not sure what the issue is, but I'm pretty sure it isn't anything that's occurred in Asterisk 12.