Summary:ASTERISK-13157: [patch] Add static values for db columns on cdr_addon_mysql
Reporter:Mark Wilkinson (markwilkinson)Labels:
Date Opened:2008-12-02 14:30:07.000-0600Date Closed:2008-12-04 13:50:00.000-0600
Versions:Frequency of
Environment:Attachments:( 0) cdr_mysql-2.patch
( 1) cdr-mysql.patch
Description:This patch adds the ability to set db columns to a static value defined in the cdr_mysql.conf file.


I added this tweek for the following reason :-
 I run serveral * servers, each one logging to a common cdr database table (to allow ease of billing).
Having defined a 'server' column in the db, each server set's the column to it's hostname, allowing the cdr's to be tracked to a specific server
Comments:By: Tilghman Lesher (tilghman) 2008-12-02 18:03:30.000-0600

The following needs to be changed:

1) The patch is currently against 1.6.0.  Changes that add new features must be against trunk.  You should find, for example, that some of the routines have changed in trunk to use ast_str, the string handling API, which is different from the method used in 1.6.0.

2) I would prefer if you implemented static values in a manner similar to what has already been done in cdr_adaptive_odbc, both in syntax, as well as in implementation.  For starters, this means altering the 'struct column' definition and including the static value there, rather than creating a separate list.

If this is something you are interested in updating your patch towards, please reply back, so effort is not duplicated.  If you are not interested in making these changes, please also reply back, so I can get this ported to trunk quickly.

By: Mark Wilkinson (markwilkinson) 2008-12-03 07:12:25.000-0600

Hi Corydon76,
  As requested, I've re-worked the patch against the addons/truck code, and have altered setting of the aliases and static values as per cdr_adaptive_odbc

I've also changed the section that defines the columns from 'aliases' to 'columns' as it reflects the usage more.

By: Digium Subversion (svnbot) 2008-12-04 13:49:59.000-0600

Repository: asterisk-addons
Revision: 704

U   trunk/UPGRADE.txt
U   trunk/cdr/cdr_addon_mysql.c
U   trunk/configs/cdr_mysql.conf.sample

r704 | tilghman | 2008-12-04 13:49:59 -0600 (Thu, 04 Dec 2008) | 6 lines

Permit static values in the MySQL backend, just like cdr_adaptive_odbc.
(closes issue ASTERISK-13157)
Reported by: markwilkinson
      cdr_mysql-2.patch uploaded by markwilkinson (license 532)