[asterisk-users] CDR_MYSQL 1.4 Database Structure

2009-12-30 Thread Robert Broyles
So I'm noticing from the docs/ on Asterisk Addons 1.4.10 that the 
database structure for cdr_mysql is:

CREATE TABLE cdr (
  calldate datetime NOT NULL default '-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 '',
  uniqueid varchar(32) NOT NULL default '',
  userfield varchar(255) NOT NULL default ''
);

Just curious if anyone has successfully patched cdr_addon_mysql to use 
accept the latest cdr fields from 1.4 ... namely: 'start', 'answer', 'end'?
Seems logical that the cdr_mysql addon should be updated to reflect the 
current cdr. And for backwards compatibility it can still accept 
'calldate'.


Thanks in advance

___
-- 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


Re: [asterisk-users] CDR_MYSQL 1.4 Database Structure

2009-12-30 Thread Tilghman Lesher
On Wednesday 30 December 2009 10:52:48 Robert Broyles wrote:
 So I'm noticing from the docs/ on Asterisk Addons 1.4.10 that the
 database structure for cdr_mysql is:

 CREATE TABLE cdr (
   calldate datetime NOT NULL default '-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 '',
   uniqueid varchar(32) NOT NULL default '',
   userfield varchar(255) NOT NULL default ''
 );

 Just curious if anyone has successfully patched cdr_addon_mysql to use
 accept the latest cdr fields from 1.4 ... namely: 'start', 'answer', 'end'?
 Seems logical that the cdr_mysql addon should be updated to reflect the
 current cdr. And for backwards compatibility it can still accept
 'calldate'.

The MySQL driver contains all of the same information, albeit in a slightly
different form.  Calldate is the same as start, calldate plus duration minus
billsec is the same as answer, and calldate plus duration is the same as end.

Generally, we do not make design changes in the middle of a release cycle,
especially given that such changes would break a great many existing systems.
Given that there's no security reason why we would need to make such a change,
it is out of the question.  While you're certainly welcome to make such a
change on your own systems, such a change will not be committed in the 1.4
addons.

In the 1.6 series and forward, we've changed the mysql driver to scan the
table metadata and adapt the queries to the table structure.  Therefore, you
could, in fact, use 'start', 'answer', and 'end' in the 1.6 series, as you
suggested, above, and it would work perfectly well.  On the other hand, if you
kept the legacy structure, that would work, too.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

___
-- 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


Re: [asterisk-users] CDR_MYSQL 1.4 Database Structure

2009-12-30 Thread Robert Broyles
Tilghman Lesher wrote:
 On Wednesday 30 December 2009 10:52:48 Robert Broyles wrote:
   
 So I'm noticing from the docs/ on Asterisk Addons 1.4.10 that the
 database structure for cdr_mysql is:

 CREATE TABLE cdr (
   calldate datetime NOT NULL default '-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 '',
   uniqueid varchar(32) NOT NULL default '',
   userfield varchar(255) NOT NULL default ''
 );

 Just curious if anyone has successfully patched cdr_addon_mysql to use
 accept the latest cdr fields from 1.4 ... namely: 'start', 'answer', 'end'?
 Seems logical that the cdr_mysql addon should be updated to reflect the
 current cdr. And for backwards compatibility it can still accept
 'calldate'.
 

 The MySQL driver contains all of the same information, albeit in a slightly
 different form.  Calldate is the same as start, calldate plus duration minus
 billsec is the same as answer, and calldate plus duration is the same as end.

 Generally, we do not make design changes in the middle of a release cycle,
 especially given that such changes would break a great many existing systems.
 Given that there's no security reason why we would need to make such a change,
 it is out of the question.  While you're certainly welcome to make such a
 change on your own systems, such a change will not be committed in the 1.4
 addons.

 In the 1.6 series and forward, we've changed the mysql driver to scan the
 table metadata and adapt the queries to the table structure.  Therefore, you
 could, in fact, use 'start', 'answer', and 'end' in the 1.6 series, as you
 suggested, above, and it would work perfectly well.  On the other hand, if you
 kept the legacy structure, that would work, too.

   
Thanks for the reply.

So my next question is could I take the cdr_mysql from 1.6's addons and 
use it in 1.4?



___
-- 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


Re: [asterisk-users] CDR_MYSQL 1.4 Database Structure

2009-12-30 Thread Gergo Csibra
Wednesday, December 30, 2009, 6:48:37 PM, Robert wrote:

 Tilghman Lesher wrote:
 On Wednesday 30 December 2009 10:52:48 Robert Broyles wrote:

 Just curious if anyone has successfully patched cdr_addon_mysql to use
 accept the latest cdr fields from 1.4 ... namely: 'start', 'answer', 'end'?
 Seems logical that the cdr_mysql addon should be updated to reflect the
 current cdr. And for backwards compatibility it can still accept
 'calldate'.
 

 The MySQL driver contains all of the same information, albeit in a slightly
 different form.  Calldate is the same as start, calldate plus duration minus
 billsec is the same as answer, and calldate plus duration is the same as end.

 Generally, we do not make design changes in the middle of a release cycle,
 especially given that such changes would break a great many existing systems.
 Given that there's no security reason why we would need to make such a 
 change,
 it is out of the question.  While you're certainly welcome to make such a
 change on your own systems, such a change will not be committed in the 1.4
 addons.

 In the 1.6 series and forward, we've changed the mysql driver to scan the
 table metadata and adapt the queries to the table structure.  Therefore, you
 could, in fact, use 'start', 'answer', and 'end' in the 1.6 series, as you
 suggested, above, and it would work perfectly well.  On the other hand, if 
 you
 kept the legacy structure, that would work, too.

   
 Thanks for the reply.

 So my next question is could I take the cdr_mysql from 1.6's addons and 
 use it in 1.4?

I don't think so. But you can define more columns, and an insert
trigger which calculates the missing fields as defined in Tilghman's
reply.

-- 
Best regards,
 Gergomailto:csi...@gmail.com


___
-- 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


Re: [asterisk-users] CDR_MYSQL 1.4 Database Structure

2009-12-30 Thread Tilghman Lesher
On Wednesday 30 December 2009 11:48:37 Robert Broyles wrote:
 So my next question is could I take the cdr_mysql from 1.6's addons and
 use it in 1.4?

No.  The APIs are significantly different enough that a backport would
require a good amount of modification.  However, there is a backport of
cdr_adaptive_odbc to 1.4:
http://svnview.digium.com/community/tilghman/branches/1.4/

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

___
-- 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