[Home]

Summary:ASTERISK-15049: Callerid is not recorded in database
Reporter:cursor (cursor)Labels:
Date Opened:2009-10-28 18:07:24Date Closed:2013-01-15 11:59:14.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Addons/cdr_mysql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:The callerid is not recorded into the CDR database using Asterisk Addons 1.6.2.0-rc1.  All other fields work as expected.

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

CREATE TABLE `cdr` (
 `id` bigint(20) unsigned NOT NULL auto_increment,
 `calldate` datetime NOT NULL default '0000-00-00 00:00:00',
 `start` datetime NOT NULL default '0000-00-00 00:00:00',
 `answer` datetime NOT NULL default '0000-00-00 00:00:00',
 `end` datetime NOT NULL default '0000-00-00 00:00:00',
 `clid` varchar(80) collate utf8_unicode_ci NOT NULL,
 `callerid` varchar(80) collate utf8_unicode_ci NOT NULL,
 `src` varchar(80) character set latin1 NOT NULL default '',
 `dst` varchar(80) character set latin1 NOT NULL default '',
 `dcontext` varchar(80) character set latin1 NOT NULL default '',
 `channel` varchar(80) character set latin1 NOT NULL default '',
 `dstchannel` varchar(80) character set latin1 NOT NULL default '',
 `lastapp` varchar(80) character set latin1 NOT NULL default '',
 `lastdata` varchar(80) character set latin1 NOT NULL default '',
 `duration` int(11) NOT NULL default '0',
 `billsec` int(11) NOT NULL default '0',
 `disposition` varchar(45) character set latin1 NOT NULL default '',
 `amaflags` int(11) NOT NULL default '0',
 `accountcode` varchar(20) collate utf8_unicode_ci NOT NULL,
 `uniqueid` varchar(149) collate utf8_unicode_ci NOT NULL,
 `userfield` varchar(255) collate utf8_unicode_ci NOT NULL,
 `cost` decimal(10,4) default '0.0000',
 `vendor` varchar(20) collate utf8_unicode_ci NOT NULL default 'none',
 `route` varchar(80) collate utf8_unicode_ci default NULL,
 `routecost` decimal(10,4) default NULL,
 PRIMARY KEY  (`id`),
 KEY `src` (`src`),
 KEY `start` (`start`)
) ENGINE=MyISAM AUTO_INCREMENT=39114 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Comments:By: Elazar Broad (ebroad) 2009-10-30 11:10:25

Per the bug guidelines, please post a verbose and debug trace. You can accomplish this by issuing:

core set verbose 3
core set debug 3

in the Asterisk CLI. Thanks!

By: cursor (cursor) 2009-11-04 18:20:11.000-0600

[Nov  4 18:13:29] DEBUG[4710] cdr_addon_mysql.c: Inserting a CDR record.
[Nov  4 18:13:29] DEBUG[4710] cdr_addon_mysql.c: SQL command as follows: INSERT INTO cdr (calldate,start,answer,end,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) VALUES ('2009-11-04 18:13:17','2009-11-04 18:13:17','2009-11-04 18:13:20','2009-11-04 18:13:29','2001','9030','oficina','SIP/2001-b79ccc80','DAHDI/1-1','Dial','DAHDI/r1/030','12','9','ANSWERED','3','general','1257379997.23')

By: Rick Ross (rickross) 2009-11-15 16:52:40.000-0600

I can confirm the same problem is occurring on my server. I issued both commands specified by ebroad above, but I did not see a cdr debug record in my console. I had, however, separately looged the sql query at the database server, and it was similar to the one provided by cursor. It made no mention of callerid or clid.

My "cdr_mysql.conf" includes the following in its [columns] section:

;
; You may also configure the field names used in the CDR table.
;
[columns]
;static "<value>" => <column>
;alias <cdrvar> => <column>
alias start => calldate
alias callerid => clid
;alias src => src
;alias dst => dst
;alias dcontext => dcontext
;alias channel => channel
;alias dstchannel => dstchannel
;alias lastapp => lastapp
;alias lastdata => lastdata
;alias duration => duration
;alias billsec => billsec
;alias disposition => disposition
;alias amaflags => amaflags
;alias accountcode => accountcode
;alias userfield => userfield
;alias uniqueid => uniqueid

By: Leif Madsen (lmadsen) 2009-12-22 14:41:08.000-0600

If anyone is able to, it would be nice if you were able to retest this with the latest 1.6.2 branch (beyond 1.6.2.0 release) as it is possible this has already been resolved (per Russell). Thanks!

By: Jost Diederichs (jost_d) 2010-01-08 12:58:56.000-0600

I had the same issue on asterisk 6.1.11.
After commenting out "alias callerid => clid" in cdr_mysql.conf, the issue went away. clid's are now properly recorded in the database. I assume, the correct mapping is now "alias clid => clid".
If this can be confirmed by the other reporters, the install instructions for the cdr_mysql addon should be updated.  
The default cdr_mysql.conf file that came with the addon rpm from ATRPMS also has the "old" (non-working) mapping in it.

By: Leif Madsen (lmadsen) 2010-01-11 14:09:59.000-0600

Or perhaps no alias needs to be defined at all now?

By: Jost Diederichs (jost_d) 2010-01-11 14:16:39.000-0600

Correct

By: Leif Madsen (lmadsen) 2010-01-11 14:28:08.000-0600

I'd like to know what versions of Asterisk are effected by this change so the documentation can be updated appropriately.

By: Matt Jordan (mjordan) 2013-01-15 11:59:09.459-0600

Confirmed that in 1.8 at least, {{alias callerid => clid}} is no longer in cdr_mysql.conf.sample.