⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cdrdriver.tex

📁 asterisk 是一个很有知名度开源软件
💻 TEX
📖 第 1 页 / 共 2 页
字号:
                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        );\end{verbatim}\end{astlisting}\section{SQLLITE}SQLite version 2 is supported in cdr\_sqlite.\section{RADIUS}\subsection{What is needed}\begin{itemize}	\item FreeRADIUS server	\item Radiusclient-ng library	\item Asterisk PBX\end{itemize}\begin{verbatim}	+--------------------+	|    Asterisk PBX    |	|                    |	|********************|	|                    |        +---------------+	|    RADIUS client   |------->| RADIUS server |	|                    |<-------| (FreeRADIUS)  |	+--------------------+        +---------------+\end{verbatim}\subsection{Steps to follow in order to have RADIUS support}\subsubsection{Installation of the Radiusclient library}	Download the sources from		\url{http://developer.berlios.de/projects/radiusclient-ng/}			Untar the source tarball:\begin{verbatim}	root@localhost:/usr/local/src# tar xvfz radiusclient-ng-0.5.2.tar.gz\end{verbatim}	Compile and install the library:\begin{verbatim}	root@localhost:/usr/local/src# cd radiusclient-ng-0.5.2	root@localhost:/usr/local/src/radiusclient-ng-0.5.2# ./configure	root@localhost:/usr/local/src/radiusclient-ng-0.5.2# make	root@localhost:/usr/local/src/radiusclient-ng-0.5.2# make install\end{verbatim}\subsubsection{Configuration of the Radiusclient library}		By default all the configuration files of the radiusclient library will	be in \path{/usr/local/etc/radiusclient-ng} directory.			File "radiusclient.conf"		Open the file and find lines containing the following:			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	running on the same host as your Asterisk PBX.			acctserver      localhost	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"}			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	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	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	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	them. A file called dictionary.digium (kept in the contrib dir)	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/}				Untar, configure, build, and install the server:\begin{verbatim}	root@localhost:/usr/local/src# tar xvfz freeradius-1.1.1.tar.gz	root@localhost:/usr/local/src# cd freeradius-1.1.1	root@localhost"/usr/local/src/freeradius-1.1.1# ./configure	root@localhost"/usr/local/src/freeradius-1.1.1# make	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.		\subsubsection{Configuration of the FreeRADIUS Server}				There are several files that have to be modified to configure the	RADIUS server. These are presented next.	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	shared secret. The shared secret must be the same string you configured	in radiusclient library.	Example:\begin{verbatim}		client myhost {		    secret = mysecret		    shortname = foo		}\end{verbatim}		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	of FreeRADIUS.		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.\subsubsection{Asterisk Accounting Configuration}	Compilation and installation:        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.	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}.	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.\section{Logged Values}\begin{verbatim}  "Asterisk-Acc-Code",          The account name of detail records  "Asterisk-Src",  "Asterisk-Dst",  "Asterisk-Dst-Ctx",           The destination context  "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\end{verbatim}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -