[Asterisk-Users] Microsoft SQL: cdr_tds.c

Erik Anderson eanders at midco.net
Wed Jul 30 09:17:27 MST 2003


We have talked about a cdr_tds.c how many times now on this list?

I recently rewrote cdr_mysql.c to use a new table structure

CREATE TABLE cdr (
  accountcode varchar(45) NOT NULL default '',
  src varchar(45) NOT NULL default '',
  dst varchar(45) NOT NULL default '',
  dcontext varchar(45) NOT NULL default '',
  clid varchar(45) NOT NULL default '',
  channel varchar(45) NOT NULL default '',
  dstchannel varchar(45) NOT NULL default '',
  lastapp varchar(45) NOT NULL default '',
  lastdata varchar(45) NOT NULL default '',
  starttime datetime NOT NULL default '0000-00-00 00:00:00',
  answertime datetime NOT NULL default '0000-00-00 00:00:00',
  endtime datetime NOT NULL default '0000-00-00 00:00:00',
  duration int(11) NOT NULL default '0',
  billsec int(11) NOT NULL default '0',
  disposition varchar(45) NOT NULL default '',
  amaflags varchar(45) NOT NULL default '',
  KEY src (src),
  KEY clid (clid),
  KEY dst (dst),
  KEY accountcode (accountcode)
) COMMENT='Asterisk CDR table';

The old cdr_mysql.c interface did not track enough CDR data for tracking
calls.

I also wrote a lot of PHP pages to get metrics on this information from this
new table.  I am not sure it is useful to others because we only wanted to
track VOIP SIP/H323 meetme conferencing usage.  We do not have PSTN lines
into Asterisk so it is in no way a billing interface.

FreeTDS is a great and stable library.  I use it to interface between my
Linux code and my VMWare running MS SQL Server 2000.

If there is a demand (and a couple hundred $ to cover 3 days of side work) I
would be more than happy to write a cdr_tds.c/readme_tds.txt and
email/commit it to asterisk.  I have to charge a little to cover my time.

Sorry, we are using MySQL, not using MS SQL or Sybase, for my "meetme
billing" information.  If we were using a TDS Database I would have written
a FreeTDS interface LONG ago for my company open sourced/released it to the
community.

If someone needs such a feature let me know.  I will be more than happy to
oblige.

Erik

> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com
> [mailto:asterisk-users-admin at lists.digium.com]On Behalf Of Steven J.
> Sobol
> Sent: Wednesday, July 30, 2003 9:48 AM
> To: asterisk-users at lists.digium.com
> Subject: Re: [Asterisk-Users] Microsoft SQL
>
>
> On Wed, 30 Jul 2003, Florian Overkamp wrote:
>
> > As suggested by another poster: MS-SQL is mostly based on
> Sybase, so any
> > Sybase driver (there is one for PHP for instance) can probably be used,
> > from AGI or otherwise...
>
> I've successfully used the FreeTDS libraries on a Linux box to connect to
> a MySQL server. The original MS SQL was based on Sybase SQL Server 4.2,
> but for SQL 7 or SQL 2000, you'll want to compile the FreeTDS library with
> version 7.0 support (you can either do 7.0 or 4.2).
>
> --
> JustThe.net Internet & Multimedia Svcs. [The Fusion of Content &
> Connectivity]
> 22674 Motnocab Road * Apple Valley, CA 92307-1950
> Steve Sobol, Proprietor
> 888.480.4NET (4638) * 248.724.4NET * sjsobol at JustThe.net
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
>




More information about the asterisk-users mailing list