[Home]

Summary:ASTERISK-01834: [post-1.0][patch] MSSQL CDR Backend
Reporter:jimkou (jimkou)Labels:
Date Opened:2004-06-15 21:52:23Date Closed:2008-01-15 15:03:20.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cdr_tds.c
( 1) cdr_tds.c.txt
( 2) cdr_tds.c.txt
( 3) cdr_tds.conf.txt
( 4) Makefile.diff.txt
Description:Add MSSQL support.

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

This program has been tested for month, seems no problems.
Comments:By: Mark Spencer (markster) 2004-06-15 22:25:32

We already have a disclaimer from you right?

By: Brian West (bkw918) 2004-06-15 22:30:05

you can already send CDR to MSSQL7/2000 with cdr_odbc.c

bkw

By: Brian West (bkw918) 2004-06-15 22:39:15

Also does the FreeTDS lib escape all the nasty stuff?

Example if your callerid contains a ' or other such thing you can do an sql injection attack.

bkw

By: jimkou (jimkou) 2004-06-16 00:58:53

To Mark:
Yes, I sent disclaimer already.

To bkw:
asterisk -> freetds -> mssql is simple than odbc
And, Oh! i forgot the ' ... (^^; I'll change the code, thanks!

By: Brian West (bkw918) 2004-06-16 16:36:42

hehe ya I had the same issue when doing cdr_odbc then realized that prepare cleaned all that mess up for me.

bkw

By: jrollyson (jrollyson) 2004-06-24 18:33:59

FreeTDS may be easier to use, but the point of UnixODBC is to avoid having code for specific databases to get out of date. Asterisk's APIs change frequently, and when it does, all the interfaces have to be updated along with it. Realisticly, if we include code for specific databases, there's only one or two of them that will be well supported at any given time, the rest may not even compile. From a development standpoint, theres only really time to maintain one interface "internally".

If we just maintain UnixODBC support, you can use whatever database you want, and theres a layer of abstraction that isolates Asterisk from some of the licensing issues with various propriatary database interfaces.

This would probably have to go in asterisk-addons, however, I personally feel that we should depreciate interfaces to specific databases.

By: Mark Spencer (markster) 2004-06-25 18:34:56

I'm actually fine with specific databases.  The only reason i haven't merged this one is that it has to have some sort of escape routine to prevent SQL injection.

By: Mark Spencer (markster) 2004-07-03 19:11:49

Jim, if you can get the escaping worked out, I'd like to go ahead and get this one merged in.  Thanks!

By: jimkou (jimkou) 2004-07-06 06:22:27

The program has been finished today but need more optimize... :p

By: Brian West (bkw918) 2004-07-16 10:59:22

is it ready for CVS?

By: Mark Spencer (markster) 2004-07-16 11:04:25

Am I missing something or does it still not escape the results?

By: Mark Spencer (markster) 2004-07-16 22:15:52

Can't modify the CDR in-place, we need to copy out the strings.

By: jimkou (jimkou) 2004-07-19 03:54:07

ok, it's finished now... :)

By: duanecox (duanecox) 2004-07-23 10:18:38

NICE WORK!  I loaded it here and like it MUCH better than ODBC MSSQL.  Like the new columns that ODBC does not have.  Thanks for your hard work.

By: Mark Spencer (markster) 2004-07-23 13:49:02

Added to CVS

By: Digium Subversion (svnbot) 2008-01-15 15:03:20.000-0600

Repository: asterisk
Revision: 3497

U   trunk/cdr/Makefile
A   trunk/cdr/cdr_tds.c
A   trunk/configs/cdr_tds.conf.sample

------------------------------------------------------------------------
r3497 | markster | 2008-01-15 15:03:19 -0600 (Tue, 15 Jan 2008) | 2 lines

Ad MSSQL CDR support (bug ASTERISK-1834)

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

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