aboutsummaryrefslogtreecommitdiffstats
path: root/doc/tex/cdrdriver.tex
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-15 13:12:51 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-15 13:12:51 +0000
commitf9c327b56545b226387601231f4864997172e0e3 (patch)
tree10e1f9eaad925e0834d16a91560765b0c2259636 /doc/tex/cdrdriver.tex
parent9940e48477e60733376232a897217c44858a8fb4 (diff)
Another major doc directory update from IgorG. This patch includes
- Many uses of the astlisting environment around verbatim text to ensure that it gets properly formatted and doesn't run off the page. - Update some things that have been deprecated. - Add escaping as needed - and more ... (closes issue #10978) Reported by: IgorG Patches: texdoc-85542-1.patch uploaded by IgorG (license 20) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85547 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'doc/tex/cdrdriver.tex')
-rw-r--r--doc/tex/cdrdriver.tex136
1 files changed, 81 insertions, 55 deletions
diff --git a/doc/tex/cdrdriver.tex b/doc/tex/cdrdriver.tex
index 35c39df97..174df5b68 100644
--- a/doc/tex/cdrdriver.tex
+++ b/doc/tex/cdrdriver.tex
@@ -14,6 +14,7 @@ Call data records can be stored in many different databases or even CSV text.
\subsection{ODBC using cdr\_odbc}
Compile, configure, and install the latest unixODBC package:
+\begin{astlisting}
\begin{verbatim}
tar -zxvf unixODBC-2.2.9.tar.gz &&
cd unixODBC-2.2.9 &&
@@ -21,8 +22,10 @@ Call data records can be stored in many different databases or even CSV text.
make &&
make install
\end{verbatim}
+\end{astlisting}
Compile, configure, and install the latest FreeTDS package:
+\begin{astlisting}
\begin{verbatim}
tar -zxvf freetds-0.62.4.tar.gz &&
cd freetds-0.62.4 &&
@@ -30,20 +33,23 @@ Call data records can be stored in many different databases or even CSV text.
--with-unixodbc=/usr/lib &&
make && make install
\end{verbatim}
+\end{astlisting}
Compile, or recompile, asterisk so that it will now add support
for cdr\_odbc.
+\begin{astlisting}
\begin{verbatim}
make clean && ./configure --with-odbc &&
make update &&
make &&
make install
\end{verbatim}
+\end{astlisting}
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.
-
+\begin{astlisting}
\begin{verbatim}
/etc/odbcinst.ini
[FreeTDS]
@@ -62,19 +68,23 @@ Call data records can be stored in many different databases or even CSV text.
tds_version = 7.0
language = us_english
\end{verbatim}
+\end{astlisting}
Only install one database connector. Do not confuse asterisk
by using both ODBC (cdr\_odbc) and FreeTDS (cdr\_tds).
- This command will erase the contents of cdr\_tds.conf
+ This command will erase the contents of cdr\_tds.conf
+\begin{astlisting}
\begin{verbatim}
[ -f /etc/asterisk/cdr_tds.conf ] > /etc/asterisk/cdr_tds.conf
\end{verbatim}
+\end{astlisting}
NOTE: unixODBC requires the freeTDS package, but asterisk does
not call freeTDS directly.
Now set up 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.
+\begin{astlisting}
\begin{verbatim}
/etc/asterisk/cdr_odbc.conf
[global]
@@ -83,9 +93,11 @@ Call data records can be stored in many different databases or even CSV text.
password=voipdbpass
loguniqueid=yes
\end{verbatim}
+\end{astlisting}
And finally, create the 'cdr' table in your mssql database.
+\begin{astlisting}
\begin{verbatim}
- CREATE TABLE cdr (
+ CREATE TABLE cdr (
[calldate] [datetime] NOT NULL ,
[clid] [varchar] (80) NOT NULL ,
[src] [varchar] (80) NOT NULL ,
@@ -104,12 +116,14 @@ Call data records can be stored in many different databases or even CSV text.
[userfield] [varchar] (255) NOT NULL
)
\end{verbatim}
+\end{astlisting}
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.
\subsection{TDS, using cdr\_tds}
Compile, configure, and install the latest FreeTDS package:
+\begin{astlisting}
\begin{verbatim}
tar -zxvf freetds-0.62.4.tar.gz &&
cd freetds-0.62.4 &&
@@ -117,23 +131,29 @@ Call data records can be stored in many different databases or even CSV text.
make &&
make install
\end{verbatim}
+\end{astlisting}
Compile, or recompile, asterisk so that it will now add support
for cdr\_tds.
+\begin{astlisting}
\begin{verbatim}
make clean && ./configure --with-tds &&
make update &&
make &&
make install
\end{verbatim}
+\end{astlisting}
Only install one database connector. Do not confuse asterisk
by using both ODBC (cdr\_odbc) and FreeTDS (cdr\_tds).
This command will erase the contents of cdr\_odbc.conf
+\begin{astlisting}
\begin{verbatim}
[ -f /etc/asterisk/cdr_odbc.conf ] > /etc/asterisk/cdr_odbc.conf
\end{verbatim}
+\end{astlisting}
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.
+\begin{astlisting}
\begin{verbatim}
/etc/asterisk/cdr_tds.conf
[global]
@@ -144,7 +164,9 @@ Call data records can be stored in many different databases or even CSV text.
password=voipdpass
charset=BIG5
\end{verbatim}
+\end{astlisting}
And finally, create the 'cdr' table in your mssql database.
+\begin{astlisting}
\begin{verbatim}
CREATE TABLE cdr (
[accountcode] [varchar] (20) NULL ,
@@ -166,6 +188,7 @@ Call data records can be stored in many different databases or even CSV text.
[uniqueid] [varchar] (32) NULL
)
\end{verbatim}
+\end{astlisting}
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.
@@ -185,6 +208,7 @@ Using MySQL for CDR records is supported by using ODBC and the cdr\_odbc module.
copy the sample cdr\_pgsql.conf file or create your own.
Here is a sample:
+\begin{astlisting}
\begin{verbatim}
/etc/asterisk/cdr_pgsql.conf
; Sample Asterisk config file for CDR logging to PostgresSQL
@@ -196,8 +220,9 @@ Using MySQL for CDR records is supported by using ODBC and the cdr\_odbc module.
user=postgres
table=cdr
\end{verbatim}
+\end{astlisting}
Now create a table in postgresql for your cdrs
-
+\begin{astlisting}
\begin{verbatim}
CREATE TABLE cdr (
calldate time NOT NULL ,
@@ -218,6 +243,7 @@ Using MySQL for CDR records is supported by using ODBC and the cdr\_odbc module.
userfield varchar (255) NOT NULL
);
\end{verbatim}
+\end{astlisting}
\section{SQLLITE}
@@ -278,46 +304,46 @@ SQLite version 2 is supported in cdr\_sqlite.
authserver localhost
- This is the hostname or IP address of the RADIUS server used for
- authentication. You will have to change this unless the server is
+ This is the hostname or IP address of the RADIUS server used for
+ authentication. You will have to change this unless the server is
running on the same host as your Asterisk PBX.
acctserver localhost
- This is the hostname or IP address of the RADIUS server used for
+ This is the hostname or IP address of the RADIUS server used for
accounting. You will have to change this unless the server is running
on the same host as your Asterisk PBX.
- \textbf{File "servers"}
+ \textbf{File "servers"}
RADIUS protocol uses simple access control mechanism based on shared
secrets that allows RADIUS servers to limit access from RADIUS clients.
- A RADIUS server is configured with a secret string and only RADIUS
+ A RADIUS server is configured with a secret string and only RADIUS
clients that have the same secret will be accepted.
- You need to configure a shared secret for each server you have
- configured in radiusclient.conf file in the previous step. The shared
+ You need to configure a shared secret for each server you have
+ configured in radiusclient.conf file in the previous step. The shared
secrets are stored in \path{/usr/local/etc/radiusclient-ng/servers} file.
- Each line contains hostname of a RADIUS server and shared secret
- used in communication with that server. The two values are separated
- by white spaces. Configure shared secrets for every RADIUS server you
+ Each line contains hostname of a RADIUS server and shared secret
+ used in communication with that server. The two values are separated
+ by white spaces. Configure shared secrets for every RADIUS server you
are going to use.
\textbf{File "dictionary"}
- Asterisk uses some attributes that are not included in the
- dictionary of radiusclient library, therefore it is necessary to add
+ Asterisk uses some attributes that are not included in the
+ dictionary of radiusclient library, therefore it is necessary to add
them. A file called dictionary.digium (kept in the contrib dir)
- was created to list all new attributes used by Asterisk.
+ was created to list all new attributes used by Asterisk.
Add to the end of the main dictionary file
\path{/usr/local/etc/radiusclient-ng/dictionary} the line:
\$INCLUDE /path/to/dictionary.digium
\subsubsection{Install FreeRADIUS Server (Version 1.1.1)}
-
+
Download sources tarball from:
\url{http://freeradius.org/}
@@ -332,8 +358,8 @@ SQLite version 2 is supported in cdr\_sqlite.
root@localhost"/usr/local/src/freeradius-1.1.1# make install
\end{verbatim}
- All the configuration files of FreeRADIUS server will be in
- /usr/local/etc/raddb directory.
+ All the configuration files of FreeRADIUS server will be in
+ /usr/local/etc/raddb directory.
\subsubsection{Configuration of the FreeRADIUS Server}
@@ -343,9 +369,9 @@ SQLite version 2 is supported in cdr\_sqlite.
File "clients.conf"
- File \path{/usr/local/etc/raddb/clients.conf} contains description of
- RADIUS clients that are allowed to use the server. For each of the
- clients you need to specify its hostname or IP address and also a
+ File \path{/usr/local/etc/raddb/clients.conf} contains description of
+ RADIUS clients that are allowed to use the server. For each of the
+ clients you need to specify its hostname or IP address and also a
shared secret. The shared secret must be the same string you configured
in radiusclient library.
@@ -357,29 +383,29 @@ SQLite version 2 is supported in cdr\_sqlite.
}
\end{verbatim}
- This fragment allows access from RADIUS clients on "myhost" if they use
- "mysecret" as the shared secret.
+ This fragment allows access from RADIUS clients on "myhost" if they use
+ "mysecret" as the shared secret.
The file already contains an entry for localhost (127.0.0.1), so if you
are running the RADIUS server on the same host as your Asterisk server,
then modify the existing entry instead, replacing the default password.
File "dictionary"
- Note: as of version 1.1.2, the dictionary.digium file ships with FreeRADIUS.
- The following procedure brings the dictionary.digium file to previous versions
+ Note: as of version 1.1.2, the dictionary.digium file ships with FreeRADIUS.
+ The following procedure brings the dictionary.digium file to previous versions
of FreeRADIUS.
- File \path{/usr/local/etc/raddb/dictionary} contains the dictionary of
- FreeRADIUS server. You have to add the same dictionary file
+ File \path{/usr/local/etc/raddb/dictionary} contains the dictionary of
+ FreeRADIUS server. You have to add the same dictionary file
(dictionary.digium), which you added to the dictionary of radiusclient-ng
library. You can include it into the main file, adding the following line at the
end of file \path{/usr/local/etc/raddb/dictionary}:
\$INCLUDE /path/to/dictionary.digium
- That will include the same new attribute definitions that are used
- in radiusclient-ng library so the client and server will understand each
- other.
+ That will include the same new attribute definitions that are used
+ in radiusclient-ng library so the client and server will understand each
+ other.
\subsubsection{Asterisk Accounting Configuration}
@@ -389,17 +415,17 @@ SQLite version 2 is supported in cdr\_sqlite.
The module will be compiled as long as the radiusclient-ng
library has been detected on your system.
- By default FreeRADIUS server will log all accounting requests into
- \path{/usr/local/var/log/radius/radacct} directory in form of plain text files.
- The server will create one file for each hostname in the directory. The
- following example shows how the log files look like.
+ By default FreeRADIUS server will log all accounting requests into
+ \path{/usr/local/var/log/radius/radacct} directory in form of plain text files.
+ The server will create one file for each hostname in the directory. The
+ following example shows how the log files look like.
Asterisk now generates Call Detail Records. See \path{/include/asterisk/cdr.h}
- for all the fields which are recorded. By default, records in comma
- separated values will be created in \path{/var/log/asterisk/cdr-csv}.
+ for all the fields which are recorded. By default, records in comma
+ separated values will be created in \path{/var/log/asterisk/cdr-csv}.
The configuration file for cdr\_radius.so module is \path{/etc/asterisk/cdr.conf}
-
+
This is where you can set CDR related parameters as well as the path to
the radiusclient-ng library configuration file.
@@ -413,20 +439,20 @@ SQLite version 2 is supported in cdr\_sqlite.
"Asterisk-Clid",
"Asterisk-Chan", The channel
"Asterisk-Dst-Chan", (if applicable)
- "Asterisk-Last-App", Last application run on the channel
- "Asterisk-Last-Data", Argument to the last channel
- "Asterisk-Start-Time",
- "Asterisk-Answer-Time",
- "Asterisk-End-Time",
- "Asterisk-Duration", Duration is the whole length that the entire
- call lasted. ie. call rx'd to hangup
- "end time" minus "start time"
- "Asterisk-Bill-Sec", The duration that a call was up after other
- end answered which will be <= to duration
- "end time" minus "answer time"
- "Asterisk-Disposition", ANSWERED, NO ANSWER, BUSY
- "Asterisk-AMA-Flags", DOCUMENTATION, BILL, IGNORE etc, specified on
- a per channel basis like accountcode.
- "Asterisk-Unique-ID", Unique call identifier
- "Asterisk-User-Field" User field set via SetCDRUserField
+ "Asterisk-Last-App", Last application run on the channel
+ "Asterisk-Last-Data", Argument to the last channel
+ "Asterisk-Start-Time",
+ "Asterisk-Answer-Time",
+ "Asterisk-End-Time",
+ "Asterisk-Duration", Duration is the whole length that the entire
+ call lasted. ie. call rx'd to hangup
+ "end time" minus "start time"
+ "Asterisk-Bill-Sec", The duration that a call was up after other
+ end answered which will be <= to duration
+ "end time" minus "answer time"
+ "Asterisk-Disposition", ANSWERED, NO ANSWER, BUSY
+ "Asterisk-AMA-Flags", DOCUMENTATION, BILL, IGNORE etc, specified on
+ a per channel basis like accountcode.
+ "Asterisk-Unique-ID", Unique call identifier
+ "Asterisk-User-Field" User field set via SetCDRUserField
\end{verbatim}