[Home]

Summary:ASTERISK-03192: Disposition is being stored as numeral.
Reporter:eko1 (eko1)Labels:
Date Opened:2005-01-05 16:00:52.000-0600Date Closed:2008-01-15 15:21:26.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CDR/cdr_odbc
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cdr_odbc.c.diff.txt
( 1) cdr_odbc.c.txt
Description:When using odbc to store cdr records, the disposition is being stored as a number, not as "ANSWERED", "BUSY", etc.. This is mainly due to the fact that the ast_cdr_disp2str(cdr->disposition) is not being called in cdr_odbc.c. It should be trivial to fix this.
Comments:By: Mark Spencer (markster) 2005-01-05 17:21:49.000-0600

Fixed in CVS head -- not sure how this should be handled for stable.  It's clear from the schema in cdr.txt that it's supposed to be a string, but stable, well, people who might be using it presumably already are counting on it being an integer.  Might be a nasty surprise, yet if it's not fixed, the documentation is wrong....  Whaaa  toooo  doooo.....

By: Russell Bryant (russell) 2005-01-08 15:11:06.000-0600

Instead of changing the docs, I went ahead and fixed this in stable and added a nice note in the ChangeLog about it.

By: Terry Wilson (twilson) 2005-01-11 01:55:44.000-0600

It is still writing as an integer do to the SQL_C_SLONG.  Changed to SQL_C_CHAR, and it fixed.  Patch attached and disclaimer on file.

By: Andrey S Pankov (casper) 2005-01-11 06:58:07.000-0600

Disposition storing should be consistent through all cdr modules, but it is NOT! e.g. cdr_sqlite uses INTEGER for disposition storing as well (even its schema says it should be int).

Other thing is that from RDBMS point of view such things (dispositions, amaflags) should be stored as numeric values or should be enums, not varchar. Storing int in varchar field won't fail, but there is no possibility to store string values in int fields. So we should be very careful here... I'm sure we should revert the change for stable and make everything consistent in head.

By: Brian West (bkw918) 2005-01-11 12:35:59.000-0600

I wrote it to store int because I felt that was the best way to do it.  Searching on an int is faster than search on a text filed in some cases.

bkw

By: Brian West (bkw918) 2005-01-11 12:37:24.000-0600

I personally dont want it to store as a char.. INT is what it should be..

bkw

By: Mark Spencer (markster) 2005-01-11 12:55:06.000-0600

Okay I turned it to an option, defaulting to the old behavior.

By: Brian West (bkw918) 2005-01-11 13:49:50.000-0600

Pending oops patch from casper.

bkw

By: Andrey S Pankov (casper) 2005-01-11 13:53:48.000-0600

Thanks to twilson for the note "01-11-05 01:55"!

By: Mark Spencer (markster) 2005-01-11 15:21:15.000-0600

Fixed in CVS head.  Thanks!

By: Russell Bryant (russell) 2005-01-12 22:04:39.000-0600

change reverted in 1.0

doc updated to say int

By: Digium Subversion (svnbot) 2008-01-15 15:20:10.000-0600

Repository: asterisk
Revision: 4687

U   trunk/cdr/cdr_odbc.c

------------------------------------------------------------------------
r4687 | markster | 2008-01-15 15:20:09 -0600 (Tue, 15 Jan 2008) | 2 lines

Make cdr_odbc store disposition as string not integer (thus matching documentation in doc/cdr.txt) (bug ASTERISK-3192)

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

http://svn.digium.com/view/asterisk?view=rev&revision=4687

By: Digium Subversion (svnbot) 2008-01-15 15:20:35.000-0600

Repository: asterisk
Revision: 4716

U   branches/v1-0/CHANGES
U   branches/v1-0/cdr/cdr_odbc.c

------------------------------------------------------------------------
r4716 | russell | 2008-01-15 15:20:35 -0600 (Tue, 15 Jan 2008) | 2 lines

fix disposition to be a string instead of an int (bug ASTERISK-3192)

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

http://svn.digium.com/view/asterisk?view=rev&revision=4716

By: Digium Subversion (svnbot) 2008-01-15 15:21:16.000-0600

Repository: asterisk
Revision: 4763

U   trunk/cdr/cdr_odbc.c
U   trunk/configs/cdr_odbc.conf.sample

------------------------------------------------------------------------
r4763 | markster | 2008-01-15 15:21:16 -0600 (Tue, 15 Jan 2008) | 2 lines

Make ODBC storage as int configurable to be string or int (bug ASTERISK-3192)

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

http://svn.digium.com/view/asterisk?view=rev&revision=4763

By: Digium Subversion (svnbot) 2008-01-15 15:21:18.000-0600

Repository: asterisk
Revision: 4765

U   trunk/cdr/cdr_odbc.c

------------------------------------------------------------------------
r4765 | markster | 2008-01-15 15:21:18 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix types for character (bug ASTERISK-3192, take 3)

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

http://svn.digium.com/view/asterisk?view=rev&revision=4765

By: Digium Subversion (svnbot) 2008-01-15 15:21:26.000-0600

Repository: asterisk
Revision: 4774

U   branches/v1-0/CHANGES
U   branches/v1-0/cdr/cdr_odbc.c
U   branches/v1-0/doc/cdr.txt

------------------------------------------------------------------------
r4774 | russell | 2008-01-15 15:21:26 -0600 (Tue, 15 Jan 2008) | 2 lines

nevermind ... (bug ASTERISK-3192)

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

http://svn.digium.com/view/asterisk?view=rev&revision=4774