[asterisk-users] Asterisk + mySQL
Ishfaq Malik
ish at pack-net.co.uk
Tue Jun 23 03:22:47 CDT 2009
Hi
The calldate column is the date and time of the call, here's the
definition of the cdr table
CREATE TABLE `cdr` (
`calldate` datetime NOT NULL default '0000-00-00 00:00:00',
`clid` varchar(80) NOT NULL default '',
`src` varchar(80) NOT NULL default '',
`dst` varchar(80) NOT NULL default '',
`dcontext` varchar(80) NOT NULL default '',
`channel` varchar(80) NOT NULL default '',
`dstchannel` varchar(80) NOT NULL default '',
`lastapp` varchar(80) NOT NULL default '',
`lastdata` varchar(80) NOT NULL default '',
`duration` int(11) NOT NULL default '0',
`billsec` int(11) NOT NULL default '0',
`disposition` varchar(45) NOT NULL default '',
`amaflags` int(11) NOT NULL default '0',
`accountcode` varchar(20) NOT NULL default '',
`userfield` varchar(255) NOT NULL default ''
);
ALTER TABLE `cdr` ADD `uniqueid` VARCHAR(32) NOT NULL default '';
ALTER TABLE `cdr` ADD INDEX ( `calldate` );
ALTER TABLE `cdr` ADD INDEX ( `dst` );
ALTER TABLE `cdr` ADD INDEX ( `accountcode` );
I got that info from here
http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql
Ish
jonas kellens wrote:
> [Jun 22 17:51:48] ERROR[13726]: cdr_addon_mysql.c:249 mysql_log:
> mysql_cdr: Failed to insert into database: (1054) Unknown column
> 'calldate' in 'field list' == Spawn extension
>
> I have the following columns (for billing) :
>
> accountcode src dst dcontext clid channel
> dstchannel lastapp lastdata start answer end duration
> billsec disposition amaflags
>
> Why does it want to write to a column calldate ?? Where is this defined ??
>
> Thanks for the help !
> Jonas.
>
>
> On Fri, 2009-06-19 at 14:13 -0500, Miguel Molina wrote:
>> jonas kellens escribió:
>>> On Thu, 2009-06-18 at 11:52 -0500, Tilghman Lesher wrote:
>>>> In modules.conf: noload => cdr_csv.so
>>>>
>>>>
>>>>
>>>
>>> Are there other modules I need to load or unload ??
>>>
>>> asterisk*CLI> module show like cdr
>>> Module
>>> Description Use Count
>>> cdr_addon_mysql.so MySQL CDR
>>> Backend 0
>>> app_setcdruserfield.so CDR user field
>>> apps 0
>>> func_cdr.so CDR dialplan
>>> function 0
>>> app_cdr.so Tell Asterisk to not maintain a CDR
>>> for 0
>>> cdr_manager.so Asterisk Manager Interface CDR
>>> Backend 0
>>> app_forkcdr.so Fork The CDR into 2 separate
>>> entities 0
>>> cdr_csv.so Comma Separated Values CDR
>>> Backend 0
>>> cdr_custom.so Customizable Comma Separated Values
>>> CDR 0
>>> 8 modules loaded
>>> asterisk*CLI> module show like odbc
>>> Module
>>> Description Use Count
>>> 0 modules loaded
>>> asterisk*CLI> module show like sql
>>> Module
>>> Description Use Count
>>> cdr_addon_mysql.so MySQL CDR
>>> Backend 0
>>> app_addon_sql_mysql.so Simple Mysql
>>> Interface 0
>>> res_config_mysql.so MySQL RealTime Configuration
>>> Driver 0
>>> 3 modules loaded
>>>
>>> modules.conf :
>>>
>>> autoload=yes
>>> noload=pbx_gtkconsole.so
>>> load=res_musiconhold.so
>>> load=cdr_addon_mysql.so
>>> noload=chan_alsa.so
>>>
>>> Why is there a /res_mysql.conf/ and a /cdr_mysql.conf/ ?? They both
>>> look alike...
>>>
>>>
>> There's no other modules you need to load/unload. To disable CSV CDR
>> recording just add what Tilghman told you into modules.conf.
>>
>> cdr_mysql.conf is for MySQL CDR backend database settings.
>> res_mysql.conf is for MySQL Asterisk Realtime Architecture (ARA)
>> backend database settings.
>>
>> Cheers,
>> --
>> Ing. Miguel Molina
>> Grupo de Tecnología
>> Millenium Phone Center
>>
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
--
Ishfaq Malik
Software Developer
PackNet Ltd
Office: 0161 660 3062
More information about the asterisk-users
mailing list