Asterisk
  1. Asterisk
  2. ASTERISK-11117

use additional mysql fields based on CDR variables

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Addons/cdr_mysql
    • Labels:
      None
    • Mantis ID:
      11642
    • Regression:
      No

      Description

      I wrote a small patch to be able to insert into the mysql CDR additionnal variables that have been set using Set(CDR(variable)).
      A additionalfields variable is loaded from cdr_mysql.conf with pipe seperated additional fields to take into account.

      The patch searches through the CDR variables for one of the additionnal fields, and if present adds it to the mysql query.

                • ADDITIONAL INFORMATION ******

      Default behaviour stays the same.
      Only fields specified in the cdr_mysql.conf and which are set for the call will be taken into account.
      There might be problems if trying to insert wrong type variables. Haven't fully tested.
      If the mysql table is to adjusted properly to reflect what's it the cdr_mysql.conf, mysql insertion will fail.

      Second time sending in a patch and haven't written C code in a while, so if there are modifications or recommendations, feel free to mention.

      1. 20071230__bug11642.diff.txt
        18 kB
        Tilghman Lesher
      2. cdr_addon_mysql-1.2.8.patch
        5 kB
        Benjamin Lawetz
      3. cdr_addon_mysql-1.4.5.patch
        6 kB
        Benjamin Lawetz
      4. cdr_mysql.conf.sample-1.4.5.patch
        0.6 kB
        Benjamin Lawetz

        Activity

        Hide
        Jason Parker added a comment -

        This is basically the same as cdr_adaptive_odbc, which automatically finds fields, and is already in tree.

        I don't know whether we want to go this route or not..

        Show
        Jason Parker added a comment - This is basically the same as cdr_adaptive_odbc, which automatically finds fields, and is already in tree. I don't know whether we want to go this route or not..
        Hide
        Sergey Tamkovich added a comment -

        qwell, why not?

        as far as i understand odbc and mysql are completley different and independent backends. So I believe that features in cdr_mysql should not depend on cdr_addaptive_odbc.

        After all, cdr_sqlite3_custom and cdr_custom doesn't prevent cdr_addaptive_odbc's existence, right?

        Show
        Sergey Tamkovich added a comment - qwell, why not? as far as i understand odbc and mysql are completley different and independent backends. So I believe that features in cdr_mysql should not depend on cdr_addaptive_odbc. After all, cdr_sqlite3_custom and cdr_custom doesn't prevent cdr_addaptive_odbc's existence, right?
        Hide
        Benjamin Lawetz added a comment -

        Added patch cdr_addon_mysql-1.2.8.patch for asterisk-addons-1.2.8

        Show
        Benjamin Lawetz added a comment - Added patch cdr_addon_mysql-1.2.8.patch for asterisk-addons-1.2.8
        Hide
        Jason Parker added a comment -

        Any new features would need to be against trunk, and not 1.2 or 1.4

        Show
        Jason Parker added a comment - Any new features would need to be against trunk, and not 1.2 or 1.4
        Hide
        Tilghman Lesher added a comment -

        Also, it would probably be good if you mirrored the functionality of cdr_adaptive_odbc, in terms of scanning the table and adapting to the existing fields

        Show
        Tilghman Lesher added a comment - Also, it would probably be good if you mirrored the functionality of cdr_adaptive_odbc, in terms of scanning the table and adapting to the existing fields
        Hide
        Tilghman Lesher added a comment -

        Okay, I've mirrored cdr_adaptive_odbc's functionality in cdr_addon_mysql. This still needs a good deal of testing before it can be committed, though.

        Show
        Tilghman Lesher added a comment - Okay, I've mirrored cdr_adaptive_odbc's functionality in cdr_addon_mysql. This still needs a good deal of testing before it can be committed, though.
        Hide
        Tilghman Lesher added a comment -

        The other benefit of doing it like this is that you can remove arbitrary fields, too.

        Show
        Tilghman Lesher added a comment - The other benefit of doing it like this is that you can remove arbitrary fields, too.
        Hide
        Tilghman Lesher added a comment -

        New patch uploaded, for trunk, tested and working.

        Show
        Tilghman Lesher added a comment - New patch uploaded, for trunk, tested and working.
        Hide
        Digium Subversion added a comment -

        Repository: asterisk-addons
        Revision: 501

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

        ------------------------------------------------------------------------
        r501 | tilghman | 2007-12-30 11:11:56 -0600 (Sun, 30 Dec 2007) | 3 lines

        Make cdr_addon_mysql work like cdr_adaptive_odbc... dynamic columns
        (Closes issue ASTERISK-11117)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk-addons?view=rev&revision=501

        Show
        Digium Subversion added a comment - Repository: asterisk-addons Revision: 501 A trunk/UPGRADE.txt U trunk/cdr_addon_mysql.c U trunk/configs/cdr_mysql.conf.sample ------------------------------------------------------------------------ r501 | tilghman | 2007-12-30 11:11:56 -0600 (Sun, 30 Dec 2007) | 3 lines Make cdr_addon_mysql work like cdr_adaptive_odbc... dynamic columns (Closes issue ASTERISK-11117 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk-addons?view=rev&revision=501

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development