[Home]

Summary:ASTERISK-15785: [regression] Set(CDR(mycol)=xxx) does not get populated in the backend when the CDR is posted
Reporter:Richard Hamnett (riksta)Labels:
Date Opened:2010-03-10 10:43:14.000-0600Date Closed:2011-07-26 15:20:00
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:CDR/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I have a simple dialplan

exten => _X.,1,Set(CDR(outbound)=1234)
exten => _X.,2,Dial(SIP/1000)

I have a mysql database table CDR which is identical to the example in the addons documentation except I have a number of custom fields, one of which is "outbound" a varchar(255)

The insert from the debug log shows that cdr_addon_mysql has no idea of the existence of the custom set field "outbound" and doesnt try to insert it.

Also if I edit the cdr_mysql.conf and add to the [columns] config:

static "123" => outbound      

I see the value 123 always populated into the DB correctly.

***MOST IMPORTANTLY*** I have this simple scenario completely working in asterisk-addons-1.6.1.0-rc3 with asterisk-1.6.1.3-rc1

Thanks for your time

****** ADDITIONAL INFORMATION ******

[Mar 10 16:18:20] DEBUG[10477] cdr_addon_mysql.c: SQL command as follows: INSERT INTO cdr (uniqueid,userfield,accountcode,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,calldate,duration,billsec,disposition,amaflags) VALUES ('track1-1268237899.0','1','1','01610000000','441610000000','adinsight-dialout-external','SIP/213.166.5.134-00000000','SIP/telco-outbound-00000001','Dial','SIP/telco-outbound/07971296525,60,Cr','2010-03-10 16:18:19','1','0','NO ANSWER','3')



[Mar 10 16:24:40] DEBUG[10595] config.c: Parsing /etc/asterisk/cdr_mysql.conf
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got hostname of localhost
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got port of 3306
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a timeout of 0
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got sock file of /var/run/mysqld/mysqld.sock
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got user of orchid_admin
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got dbname of orchid_system
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got password of XXXXXXXXX
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Not running in calldate compatibility mode
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got DB charset of
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Successfully connected to MySQL database.
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: SQL command as follows: SET NAMES ''
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'uniqueid' of type 'varchar(32)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'uniqueid'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'uniqueid'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(32)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'userfield' of type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'userfield'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'userfield'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'accountcode' of type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'accountcode'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'accountcode'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'src' of type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'src'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'src'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'dst' of type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'dst'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'dst'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'dcontext' of type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'dcontext'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'dcontext'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'clid' of type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'clid'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'callerid'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'channel' of type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'channel'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'channel'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'dstchannel' of type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'dstchannel'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'dstchannel'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'lastapp' of type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'lastapp'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'lastapp'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(80)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'lastdata' of type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'lastdata'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'lastdata'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'calldate' of type 'datetime'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'calldate'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'start'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'datetime'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'duration' of type 'int(11)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'duration'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'duration'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'int(11)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'billsec' of type 'int(11)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'billsec'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'billsec'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'int(11)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'disposition' of type 'varchar(45)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'disposition'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'disposition'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(45)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'amaflags' of type 'int(11)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'amaflags'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'amaflags'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'int(11)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'notified' of type 'tinyint(1)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'notified'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'notified'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'tinyint(1)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Got a field 'outbound' of type 'varchar(255)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c: Entry name 'outbound'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:    cdrname 'outbound'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:     static '(null)'
[Mar 10 16:24:40] DEBUG[10595] cdr_addon_mysql.c:       type 'varchar(255)'
Comments:By: Tilghman Lesher (tilghman) 2010-03-10 10:50:27.000-0600

After debugging this on the -dev channel, it appears that the value is not present on the CDR when posted to the backend, so what likely occurred is that when the bridge CDR was created, it failed to properly inherit custom variables on the original CDR.

By: Richard Hamnett (riksta) 2010-03-11 10:00:11.000-0600

using the "h" extension after the bridge indeed allows the custom variable to be set into the database "cdr" table.

This seems to align with tilghman's comment above about the original CDR vars not being copied after the bridge occurs.

By: Richard Hamnett (riksta) 2010-03-24 11:38:31

Hi I would like to assist on this issue, can anyone give a suggestion as to which part of the codebase I should be looking at? Or give any insight as to where they think this issue occurs, I can then try to create a patch.

By: Tilghman Lesher (tilghman) 2010-03-24 12:21:02

I don't really know where the problem lies, but the bridge code resides in res_features.c (or main/features.c, depending upon the version).

By: Richard Hamnett (riksta) 2010-03-24 13:51:37

Thanks, I am now using meld to go though the diff between a working version on 1.6.1 and the 1.6.2.5 to see if I can pick out anything obvious!

By: Richard Hamnett (riksta) 2010-04-06 07:00:45

Sadly, I could not find anything glaringly obvious in the diffs, I tested a patch which reverted a number of lines of code I suspected might be the cause and it made no difference.. so I will have to leave it with you guys. Thanks

By: Richard Hamnett (riksta) 2010-04-26 05:31:54

Is someone able to kindly give me a rough idea of the position of this regression in the todos? It would aid in our planning. Thanks

By: Richard Hamnett (riksta) 2010-05-23 06:52:03

Hi can we please get the Regression status of this bug set to "yes". Thanks

By: Richard Hamnett (riksta) 2010-08-25 11:04:54

Hi I am wondering about the status of this, and if the 1.8 branch has improvement?

By: Russell Bryant (russell) 2011-07-26 15:19:53.012-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

If this is still an issue, please open a new issue so it can be re-triaged appropriately. Thanks!