[Home]

Summary:ASTERISK-06256: [patch][post 1.4] make fields configurable
Reporter:Ivan F. Martinez (ivanfm)Labels:
Date Opened:2006-02-05 15:50:16.000-0600Date Closed:2011-06-07 14:10:29
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CDR/cdr_odbc
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk_cdr_odbc_4.patch
( 1) asterisk_cdr_odbc.patch
Description:This is the first version of a patch to make possible to use a complete user defined cdr table.

I will make more adjusts in the patch, I'm making available for anyone who wants to test, because it is usable now, and I want to get more ideas.

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

Needs the patch : http://bugs.digium.com/view.php?id=6417

sample data to be used on cdr_odbc.conf
--------------------------
[fields]
clid=${CDR(clid)}
src=${CDR(src)}
dst=${CDR(dst)}
dcontext=${CDR(dcontext)}
channel=${CDR(channel)}
dstchannel=${CDR(dstchannel)}
lastapp=${CDR(lastapp)}
lastdata=${CDR(lastdata)}
duration=INTEGER=${CDR(duration)}
billsec=INTEGER=${CDR(billsec)}
disposition=${CDR(disposition)}
amaflags=INTEGER=${CDR(amaflags_code)}
accountcode=${CDR(accountcode)}
uniqueid=${CDR(uniqueid)}
userfield=${CDR(userfield)}
------------------------------
Comments:By: Ivan F. Martinez (ivanfm) 2006-02-09 18:18:46.000-0600

using new 6417 patch the format for amaflags will be :

amaflags=INTEGER=${CDR(amaflags|u)}

By: Tilghman Lesher (tilghman) 2006-03-06 15:29:12.000-0600

If you're going to specify the format for any, I suggest that you specify the format for all, in a slightly different format:

amaflags=integer,${CDR(amaflags|u)}
src=string,${CDR(src)}

etc.  This is the standard string layout in Asterisk configuration files.  Additionally, you need to update your patch to against trunk, as this is a new feature and will never be part of 1.2.

You're also using a function which is not threadsafe, declared as void (void).  All functions need to be threadsafe or they must have a reasonable reason for not doing so, plus a mutex around what calls them, to protect against this.

By: Ivan F. Martinez (ivanfm) 2006-03-06 20:23:50.000-0600

I will make the changes and test on trunk, what format do you suggest to specify if the field can be null or not ?

The functions odbc_close and odbc_preparesql are called from places where the mutex is used.

By: Serge Vecher (serge-v) 2006-05-03 16:30:53

ivanfm: how are those test going?

By: Serge Vecher (serge-v) 2006-05-22 13:33:01

ivanfm: please come back ...

By: Serge Vecher (serge-v) 2006-06-05 19:57:47

hey, I've seen you on IRC -- are you still working on this?

By: Ivan F. Martinez (ivanfm) 2006-06-07 07:02:15

I still use it in 1.2, I did not have much time to test this on trunk.

By: Serge Vecher (serge-v) 2006-06-07 09:04:07

well, you may want to consider to get a patch for trunk, otherwise it will not make it into the 1.4 tree ...

By: Ivan F. Martinez (ivanfm) 2006-06-17 05:05:08

I have migrated my home system to trunk.
The patch is tested on trunk with unixODBC and DB2 express-c.

By: Serge Vecher (serge-v) 2006-06-19 09:24:10

+ * XXX MUST BE UPDATED TO USE res_odbc
does this mean you are still working on this patch?

By: Ivan F. Martinez (ivanfm) 2006-06-19 13:12:32

Only after this changes are approved, I will go to next step and change to use res_odbc.

The current state of patch is to make fields configurable.
After this is approved and applied I can go to a next patch to reuse the code on res_odbc. Also the migration to res_odbc depends of the other patch on res_odbc

The comment is only to remember the next step for this module, because does not make sense recreate here things already done better in res_odbc.

By: Serge Vecher (serge-v) 2006-06-19 13:32:08

ok, at this point I'll mark it as [post 1.4] so that this can be looked at for trunk when 1.4 beta is forked. Thanks

By: Ivan F. Martinez (ivanfm) 2006-06-19 15:19:21

My idea was to put it for 1.4.
And after 1.4 with the changes on res_odbc refactor this module too.
The feature are complete and tested since 1.2.
The use of res_odbc is only to simplify the code and maintenance.

By: Serge Vecher (serge-v) 2006-06-19 15:21:03

ivanfm: I do not have commit privileges -- can you please mail the asterisk-dev list to get some feedback on whether this can go in as is? Thanks

By: jmls (jmls) 2006-10-31 12:05:38.000-0600

ivanfm, did you mail the asterisk-dev list as suggested ?

By: jmls (jmls) 2006-12-01 12:38:17.000-0600

ping ping. Housekeeping. Did you get feedback ?

By: jmls (jmls) 2007-05-28 02:22:13

erm, triple ping. Will have to close this soon due to lack of response

By: Tilghman Lesher (tilghman) 2007-05-28 02:47:44

Now that cdr_adaptive_odbc has been merged to trunk, I believe these changes are redundant.  I encourage you to try out that module, as it solves some of the problems you have been combatting in this bugset.