[Asterisk-doc] docs advanced-config.xml,1.5,1.6

blitzrage asterisk-doc@lists.digium.com
Wed, 11 Aug 2004 19:12:23 +0000


Comments:
Update of /cvsroot/asterisk/docs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28796

Modified Files:
	advanced-config.xml 
Log Message:
blitzrage
- Information regarding inserting CDR records into an MSSQL database via
unixODBC or FreeTDS.  Submitted to the mailing list by Mark Spencer.
Authored by Duane Cox.
Index: advanced-config.xml
===================================================================
RCS file: /cvsroot/asterisk/docs/advanced-config.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** advanced-config.xml	22 Jul 2004 19:06:39 -0000	1.5
--- advanced-config.xml	11 Aug 2004 19:12:17 -0000	1.6
***************
*** 341,345 ****
  			</para>
  			<para>
! 				This listing is with asterisk running, and zapata using the channels. If
  				you got this far, you're good to go.
  			</para>
--- 341,345 ----
  			</para>
  			<para>
! 				This listing is with Asterisk running, and zapata using the channels. If
  				you got this far, you're good to go.
  			</para>
***************
*** 348,352 ****
  			</para>
  			<para>
! 				Hail * !
  			</para>
  			<para>
--- 348,352 ----
  			</para>
  			<para>
! 				Hail Asterisk !
  			</para>
  			<para>
***************
*** 655,660 ****
  		</sect2>
  		<sect2>
! 			<title>CDR and MySQL</title>
! 			<para/>
  		</sect2>
  		<sect2>
--- 655,898 ----
  		</sect2>
  		<sect2>
! 			<title>CDR - Call Data Records</title>
! 			<para>
! 			Call data records can be stored in many different databases or even CSV text.
! 			</para>
! 			<sect3>
! 				<title>MSSQL</title>
! 				<para>
! 				Asterisk can currently store CDRs into an MSSQL database 
! 				two different ways:  cdr_odbc.c or cdr_tds.c
! 				</para>
! 				<para>
! 				Call Data Records can be stored using unixODBC (which requires
! 				the FreeTDS package) [cdr_odbc.c] or directly by using just the
! 				FreeTDS package [cdr_tds.c]  The following provide some
! 				examples known to get asterisk working with mssql.
! 				NOTE:  Only choose one db connector.
! 				</para>
! 				<sect4>
! 					<title>ODBC [cdr_odbc.c]</title>
! 					<para>
! 					Compile, configure, and install the latest unixODBC package:
! 					</para>
! 					<programlisting>
! 					tar -zxvf unixODBC-2.2.9.tar.gz &&
! 					cd unixODBC-2.2.9 &&
! 					./configure --sysconfdir=/etc --prefix=/usr --disable-gui &&
! 					make &&
! 					make install
! 					</programlisting>
! 					<para>
! 					Compile, configure, and install the latest FreeTDS package:
! 					</para>
! 					<programlisting>
! 					tar -zxvf freetds-0.62.4.tar.gz &&
! 					cd freetds-0.62.4 &&
! 					./configure --prefix=/usr --with -tdsver=7.0 \
! 					     --with-unixodbc=/usr/lib &&
! 					make &&
! 					make install
! 					</programlisting>
! 
! 					<para>
! 					Compile, or recompile, Asterisk so that it will now add support
! 					for cdr_odbc.c
! 					</para>
! 
! 					<programlisting>
! 					make clean &&
! 					make update &&
! 					make &&
! 					make install
! 					</programlisting>
! 
! 					<para>
! 					Setup odbc configuration files.  These are working examples
! 					from my system.  You will need to modify for your setup.
! 					You are not required to store usernames or passwords here.
! 					</para>
! 
! 					<para>
! 					<filename>/etc/odbcinst.ini</filename>				
! 					</para>
! 
! 					<programlisting>
! 					[FreeTDS]
! 					Description    = FreeTDS ODBC driver for MSSQL
! 					Driver         = /usr/lib/libtdsodbc.so
! 					Setup          = /usr/lib/libtdsS.so
! 					FileUsage      = 1
! 					</programlisting>
! 
! 					<para>
! 					<filename>/etc/odbc.ini</filename>
! 					</para>
! 
! 					<programlisting>
! 					[MSSQL-asterisk]
! 					description         = Asterisk ODBC for MSSQL
! 					driver              = FreeTDS
! 					server              = 192.168.1.25
! 					port                = 1433
! 					database            = voipdb
! 					tds_version         = 7.0
! 					language            = us_english
! 					</programlisting>
! 
! 					<para>
! 					Only install one database connector.  Do not confuse asterisk
! 					by using both ODBC (cdr_odbc.c) and FreeTDS (cdr_tds.c).
! 					This command will erase the contents of cdr_tds.conf
! 					</para>
! 
! 					<para>
! 					<command>[ -f /etc/asterisk/cdr_tds.conf ] > /etc/asterisk/cdr_tds.conf</command>
! 					</para>
! 
! 					<para>
! 					NOTE:  unixODBC requires the freeTDS package, but asterisk does
! 					not call freeTDS directly.
! 					</para>
! 
! 					<para>
! 					Setup cdr_odbc configuration files.  These are working samples
! 					from my system.  You will need to modify for your setup. Define
! 					your usernames and passwords here, secure file as well.
! 					</para>
! 
! 					<para>
! 					<filename>/etc/asterisk/cdr_odbc.conf</filename>
! 					</para>
! 
! 					<programlisting>
! 					[global]
! 					dsn=MSSQL-asterisk
! 					username=voipdbuser
! 					password=voipdbpass
! 					loguniqueid=yes
! 					</programlisting>
! 
! 					<para>
! 					And finally, create the 'cdr' table in your mssql database.
! 					</para>
! 
! 					<programlisting>
! 					CREATE TABLE cdr (
! 					       [calldate]      [datetime]              NOT NULL ,
! 					       [clid]          [varchar] (80)          NOT NULL ,
! 					       [src]           [varchar] (80)          NOT NULL ,
! 					       [dst]           [varchar] (80)          NOT NULL ,
! 					       [dcontext]      [varchar] (80)          NOT NULL ,
! 					       [channel]       [varchar] (80)          NOT NULL ,
! 					       [dstchannel]    [varchar] (80)          NOT NULL ,
! 					       [lastapp]       [varchar] (80)          NOT NULL ,
! 					       [lastdata]      [varchar] (80)          NOT NULL ,
! 					       [duration]      [int]                   NOT NULL ,
! 					       [billsec]       [int]                   NOT NULL ,
! 					       [disposition]   [varchar] (45)          NOT NULL ,
! 					       [amaflags]      [int]                   NOT NULL ,
! 					       [accountcode]   [varchar] (20)          NOT NULL ,
! 					       [uniqueid]      [varchar] (32)          NOT NULL ,
! 					       [userfield]     [varchar] (255)         NOT NULL
! 					)
! 					</programlisting>
! 
! 					<para>
! 					Start asterisk in verbose mode, you should see that asterisk
! 					logs a connection to the database and will now record every
! 					call to the database when it's complete.
! 					</para>
! 				</sect4>
! 
! 				<sect4>
! 					<title>TDS [cdr_tds.c]</title>
! 					<para>
! 					Compile, configure, and install the latest FreeTDS package:
! 					</para>
! 
! 					<programlisting>
! 					tar -zxvf freetds-0.62.4.tar.gz &&
! 					cd freetds-0.62.4 &&
! 					./configure --prefix=/usr --with-tdsver=7.0
! 					make &&
! 					make install
! 					</programlisting>
! 
! 					<para>
! 					Compile, or recompile, asterisk so that it will now add support
! 					for cdr_tds.c  (Currently only asterisk CVS supports cdr_tds.c)
! 					</para>
! 
! 					<programlisting>
! 					make clean &&
! 					make update &&
! 					make &&
! 					make install
! 					</programlisting>
! 
! 					<para>
! 					Only install one database connector.  Do not confuse asterisk
! 					by using both ODBC (cdr_odbc.c) and FreeTDS (cdr_tds.c).
! 					This command will erase the contents of cdr_odbc.conf
! 					</para>
! 
! 					<para>
! 					<command>[ -f /etc/asterisk/cdr_odbc.conf ] > /etc/asterisk/cdr_odbc.conf</command>
! 					</para>
! 
! 					<para>
! 					Setup cdr_tds configuration files.  These are working samples
! 					from my system.  You will need to modify for your setup. Define
! 					your usernames and passwords here, secure file as well.
! 					</para>
! 
! 					<para>
! 					<filename>/etc/asterisk/cdr_tds.conf</filename>
! 					</para>
! 
! 					<programlisting>
! 					[global]
! 					hostname=192.168.1.25
! 					port=1433
! 					dbname=voipdb
! 					user=voipdbuser
! 					password=voipdpass
! 					charset=BIG5
! 					</programlisting>
! 
! 					<para>
! 					And finally, create the 'cdr' table in your mssql database.
! 					</para>
! 
! 					<programlisting>
! 					CREATE TABLE cdr (
! 					        [accountcode]   [varchar] (20)          NULL ,
! 					        [src]           [varchar] (80)          NULL ,
! 					        [dst]           [varchar] (80)          NULL ,
! 					        [dcontext]      [varchar] (80)          NULL ,
! 					        [clid]          [varchar] (80)          NULL ,
! 					        [channel]       [varchar] (80)          NULL ,
! 					        [dstchannel]    [varchar] (80)          NULL ,
! 					        [lastapp]       [varchar] (80)          NULL ,
! 					        [lastdata]      [varchar] (80)          NULL ,
! 					        [start]         [datetime]              NULL ,
! 					        [answer]        [datetime]              NULL ,
! 					        [end]           [datetime]              NULL ,
! 					        [duration]      [int]                   NULL ,
! 					        [billsec]       [int]                   NULL ,
! 					        [disposition]   [varchar] (20)          NULL ,
! 					        [amaflags]      [varchar] (16)          NULL ,
! 					        [uniqueid]      [varchar] (32)          NULL
! 					)
! 					</programlisting>
! 
! 					<para>
! 					Start asterisk in verbose mode, you should see that asterisk
! 					logs a connection to the database and will now record every
! 					call to the database when it's complete.
! 					</para>
! 				</sect4>
! 			</sect3>
  		</sect2>
  		<sect2>