mirror of https://github.com/asterisk/asterisk
these chanes will only be done in the trunk. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58955 65c4cc65-6c06-0410-ace0-fbb531ad65f31.4
parent
2fc431b373
commit
1b8da31130
@ -0,0 +1,74 @@
|
||||
Files in the /doc directory:
|
||||
----------------------------
|
||||
In addition to these files, there is a lot of documentation of various
|
||||
configuration options in the sample configuration files, in the /configs
|
||||
directory of your source code
|
||||
|
||||
Start here
|
||||
----------
|
||||
security.txt IMPORTANT INFORMATION ABOUT ASTERISK SECURITY
|
||||
hardware.txt Hardware supported by Asterisk
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
configuration.txt Features in the configuration parser
|
||||
extensions.txt Basics about the dialplan
|
||||
extconfig.txt How to use databases for configuration of Asterisk (ARA)
|
||||
ip-tos.txt About the IP Type Of Service settings
|
||||
realtime.txt The Asterisk Realtime Architecture - database support
|
||||
freetds.txt Information about the FreeTDS support
|
||||
ael.txt Information about the Asterisk Extension Language
|
||||
|
||||
Misc
|
||||
----
|
||||
PEERING The General Peering Agreement for Dundi
|
||||
ajam.txt About the HTTP-based manager interface
|
||||
app_sms.txt How to configure the SMS application
|
||||
asterisk.conf.txt Documentation of various options in asterisk.conf
|
||||
callingpres.txt Settings for Caller ID presentation
|
||||
billing.txt Call Data Record information
|
||||
cliprompt.txt How to change the Asterisk CLI prompt
|
||||
dundi.txt Dundi - a discovery protocol
|
||||
enum.txt Enum support in Asterisk
|
||||
ices.txt Integrating ICEcast streaming in Asterisk
|
||||
jitterbuffer.txt About the IAX2 jitterbuffer implementation
|
||||
math.txt About the math() application
|
||||
mp3.txt About MP3 support in Asterisk
|
||||
musiconhold-fpm.txt Free Music On Hold music
|
||||
mysql.txt About MYSQL support in Asterisk
|
||||
odbcstorage.txt Voicemail storage of messages in UnixODBC
|
||||
privacy.txt Privacy enhancements in Asterisk
|
||||
queuelog.txt Agent and queue logging
|
||||
channelvariables.txt Channel variables
|
||||
cdrdrivers.txt About CDR storage in various databases (needs update)
|
||||
asterisk-mib.txt SNMP mib for Asterisk (net-snmp)
|
||||
digium-mib.txt SNMP mib for Asterisk (net-snmp)
|
||||
|
||||
Channel drivers
|
||||
---------------
|
||||
misdn.txt The mISDN channel driver for ISDN BRI cards
|
||||
h323.txt How to compile and configure the H.323 channel
|
||||
chaniax.txt About the IAX2 protocol support in Asterisk
|
||||
localchannel.txt The local channel is a "gosub" in the dialplan
|
||||
|
||||
Portability
|
||||
-----------
|
||||
cygwin.txt Compiling Asterisk on CygWin platforms (Windows)
|
||||
|
||||
For developers
|
||||
--------------
|
||||
See http://www.asterisk.org/developers for more information
|
||||
|
||||
manager.txt About the AMI - Asterisk Manager Interface
|
||||
for third party call control and PBX management
|
||||
backtrace.txt How to produce a backtrace when Asterisk crashes
|
||||
CODING-GUIDELINES Guidelines for developers
|
||||
channels.txt What is a channel?
|
||||
externalivr.txt Documentation of the protocol used in externalivr()
|
||||
linkedlists.txt How to develop linked lists in Asterisk (old)
|
||||
iax.txt About the IAX protocol
|
||||
apps.txt About application development
|
||||
model.txt About the call model in Asterisk (old)
|
||||
modules.txt How Asterisk modules work
|
||||
datastores.txt About channel data stores
|
||||
speechrec.txt The Generic Speech Recognition API
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,10 @@
|
||||
Asterisk applications register themselves with ast_application_register.
|
||||
They should have a short, unique name, and an exec function which takes
|
||||
as its arguments a channel and some data that might be useful for callback
|
||||
stuff. Remember to keep track of how many and which channels are using
|
||||
your application so that should the module need to be unloaded
|
||||
(particularly force unloaded), you will be able to ast_softhangup all the
|
||||
channels. An application should *never* call ast_hangup on the channel
|
||||
that it is running on (although it could conceivably hang up other
|
||||
channels that it allocates). See app_playback.c as an example of a simple
|
||||
application.
|
File diff suppressed because it is too large
Load Diff
@ -1,130 +0,0 @@
|
||||
\subsubsection{Asterisk Main Configuration File}
|
||||
|
||||
Below is a sample of the main Asterisk configuration file,
|
||||
asterisk.conf. Note that this file is not provided in
|
||||
sample form, because the Makefile creates it when needed
|
||||
and does not touch it when it already exists.
|
||||
|
||||
\begin{verbatim}
|
||||
[directories]
|
||||
; Make sure these directories have the right permissions if not
|
||||
; running Asterisk as root
|
||||
|
||||
; Where the configuration files (except for this one) are located
|
||||
astetcdir => /etc/asterisk
|
||||
|
||||
; Where the Asterisk loadable modules are located
|
||||
astmoddir => /usr/lib/asterisk/modules
|
||||
|
||||
; Where additional 'library' elements (scripts, etc.) are located
|
||||
astvarlibdir => /var/lib/asterisk
|
||||
|
||||
; Where AGI scripts/programs are located
|
||||
astagidir => /var/lib/asterisk/agi-bin
|
||||
|
||||
; Where spool directories are located
|
||||
; Voicemail, monitor, dictation and other apps will create files here
|
||||
; and outgoing call files (used with pbx_spool) must be placed here
|
||||
astspooldir => /var/spool/asterisk
|
||||
|
||||
; Where the Asterisk process ID (pid) file should be created
|
||||
astrundir => /var/run/asterisk
|
||||
|
||||
; Where the Asterisk log files should be created
|
||||
astlogdir => /var/log/asterisk
|
||||
|
||||
|
||||
[options]
|
||||
;Under "options" you can enter configuration options
|
||||
;that you also can set with command line options
|
||||
|
||||
; Verbosity level for logging (-v)
|
||||
verbose = 0
|
||||
|
||||
; Debug: "No" or value (1-4)
|
||||
debug = 3
|
||||
|
||||
; Background execution disabled (-f)
|
||||
nofork=yes | no
|
||||
|
||||
; Always background, even with -v or -d (-F)
|
||||
alwaysfork=yes | no
|
||||
|
||||
; Console mode (-c)
|
||||
console= yes | no
|
||||
|
||||
; Execute with high priority (-p)
|
||||
highpriority = yes | no
|
||||
|
||||
; Initialize crypto at startup (-i)
|
||||
initcrypto = yes | no
|
||||
|
||||
; Disable ANSI colors (-n)
|
||||
nocolor = yes | no
|
||||
|
||||
; Dump core on failure (-g)
|
||||
dumpcore = yes | no
|
||||
|
||||
; Run quietly (-q)
|
||||
quiet = yes | no
|
||||
|
||||
; Force timestamping in CLI verbose output (-T)
|
||||
timestamp = yes | no
|
||||
|
||||
; User to run asterisk as (-U) NOTE: will require changes to
|
||||
; directory and device permissions
|
||||
runuser = asterisk
|
||||
|
||||
; Group to run asterisk as (-G)
|
||||
rungroup = asterisk
|
||||
|
||||
; Enable internal timing support (-I)
|
||||
internal_timing = yes | no
|
||||
|
||||
; These options have no command line equivalent
|
||||
|
||||
; Cache record() files in another directory until completion
|
||||
cache_record_files = yes | no
|
||||
record_cache_dir = <dir>
|
||||
|
||||
; Build transcode paths via SLINEAR
|
||||
transcode_via_sln = yes | no
|
||||
|
||||
; send SLINEAR silence while channel is being recorded
|
||||
transmit_silence_during_record = yes | no
|
||||
|
||||
; The maximum load average we accept calls for
|
||||
maxload = 1.0
|
||||
|
||||
; The maximum number of concurrent calls you want to allow
|
||||
maxcalls = 255
|
||||
|
||||
; Allow #exec entries in configuration files
|
||||
execincludes = yes | no
|
||||
|
||||
; Don't over-inform the Asterisk sysadm, he's a guru
|
||||
dontwarn = yes | no
|
||||
|
||||
; System name. Used to prefix CDR uniqueid and to fill \${SYSTEMNAME}
|
||||
systemname = <a_string>
|
||||
|
||||
; Should language code be last component of sound file name or first?
|
||||
; when off, sound files are searched as <path>/<lang>/<file>
|
||||
; when on, sound files are search as <lang>/<path>/<file>
|
||||
; (only affects relative paths for sound files)
|
||||
languageprefix = yes | no
|
||||
|
||||
|
||||
[files]
|
||||
; Changing the following lines may compromise your security
|
||||
; Asterisk.ctl is the pipe that is used to connect the remote CLI
|
||||
; (asterisk -r) to Asterisk. Changing these settings change the
|
||||
; permissions and ownership of this file.
|
||||
; The file is created when Asterisk starts, in the "astrundir" above.
|
||||
|
||||
;astctlpermissions = 0660
|
||||
;astctlowner = root
|
||||
;astctlgroup = asterisk
|
||||
;astctl = asterisk.ctl
|
||||
|
||||
\end{verbatim}
|
@ -0,0 +1,83 @@
|
||||
Asterisk Main Configuration File
|
||||
-----------------------------------------------------
|
||||
Below is a sample of the main Asterisk configuration file,
|
||||
asterisk.conf. Note that this file is _not_ provided in
|
||||
sample form, because the Makefile creates it when needed
|
||||
and does not touch it when it already exists.
|
||||
|
||||
---------------
|
||||
|
||||
[directories]
|
||||
; Make sure these directories have the right permissions if not
|
||||
; running Asterisk as root
|
||||
|
||||
; Where the configuration files (except for this one) are located
|
||||
astetcdir => /etc/asterisk
|
||||
|
||||
; Where the Asterisk loadable modules are located
|
||||
astmoddir => /usr/lib/asterisk/modules
|
||||
|
||||
; Where additional 'library' elements (scripts, etc.) are located
|
||||
astvarlibdir => /var/lib/asterisk
|
||||
|
||||
; Where AGI scripts/programs are located
|
||||
astagidir => /var/lib/asterisk/agi-bin
|
||||
|
||||
; Where spool directories are located
|
||||
; Voicemail, monitor, dictation and other apps will create files here
|
||||
; and outgoing call files (used with pbx_spool) must be placed here
|
||||
astspooldir => /var/spool/asterisk
|
||||
|
||||
; Where the Asterisk process ID (pid) file should be created
|
||||
astrundir => /var/run/asterisk
|
||||
|
||||
; Where the Asterisk log files should be created
|
||||
astlogdir => /var/log/asterisk
|
||||
|
||||
|
||||
[options]
|
||||
;Under "options" you can enter configuration options
|
||||
;that you also can set with command line options
|
||||
|
||||
verbose = 0 ; Verbosity level for logging (-v)
|
||||
debug = 3 ; Debug: "No" or value (1-4)
|
||||
nofork=yes | no ; Background execution disabled (-f)
|
||||
alwaysfork=yes | no ; Always background, even with -v or -d (-F)
|
||||
console= yes | no ; Console mode (-c)
|
||||
highpriority = yes | no ; Execute with high priority (-p)
|
||||
initcrypto = yes | no ; Initialize crypto at startup (-i)
|
||||
nocolor = yes | no ; Disable ANSI colors (-n)
|
||||
dumpcore = yes | no ; Dump core on failure (-g)
|
||||
quiet = yes | no ; Run quietly (-q)
|
||||
timestamp = yes | no ; Force timestamping in CLI verbose output (-T)
|
||||
runuser = asterisk ; User to run asterisk as (-U) NOTE: will require changes to
|
||||
; directory and device permissions
|
||||
rungroup = asterisk ; Group to run asterisk as (-G)
|
||||
internal_timing = yes | no ; Enable internal timing support (-I)
|
||||
|
||||
;These options have no command line equivalent
|
||||
cache_record_files = yes | no ; Cache record() files in another directory until completion
|
||||
record_cache_dir = <dir>
|
||||
transcode_via_sln = yes | no ; Build transcode paths via SLINEAR
|
||||
transmit_silence_during_record = yes | no ; send SLINEAR silence while channel is being recorded
|
||||
maxload = 1.0 ; The maximum load average we accept calls for
|
||||
maxcalls = 255 ; The maximum number of concurrent calls you want to allow
|
||||
execincludes = yes | no ; Allow #exec entries in configuration files
|
||||
dontwarn = yes | no ; Don't over-inform the Asterisk sysadm, he's a guru
|
||||
systemname = <a_string> ; System name. Used to prefix CDR uniqueid and to fill ${SYSTEMNAME}
|
||||
languageprefix = yes | no ; Should language code be last component of sound file name or first?
|
||||
; when off, sound files are searched as <path>/<lang>/<file>
|
||||
; when on, sound files are search as <lang>/<path>/<file>
|
||||
; (only affects relative paths for sound files)
|
||||
|
||||
[files]
|
||||
; Changing the following lines may compromise your security
|
||||
; Asterisk.ctl is the pipe that is used to connect the remote CLI
|
||||
; (asterisk -r) to Asterisk. Changing these settings change the
|
||||
; permissions and ownership of this file.
|
||||
; The file is created when Asterisk starts, in the "astrundir" above.
|
||||
|
||||
;astctlpermissions = 0660
|
||||
;astctlowner = root
|
||||
;astctlgroup = asterisk
|
||||
;astctl = asterisk.ctl
|
@ -1,134 +0,0 @@
|
||||
% To generate a PDF from this, install the "rubber" tool, and the LaTeX
|
||||
% dependencies for it. Then, run:
|
||||
%
|
||||
% rubber asterisk.tex
|
||||
%
|
||||
% http://www.pps.jussieu.fr/~beffara/soft/rubber/
|
||||
|
||||
\documentclass[12pt,a4]{report}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\author{Asterisk Development Team \\ Asterisk.org}
|
||||
\title{Asterisk Reference Information \\ Version ASTERISKVERSION}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
\tableofcontents
|
||||
|
||||
\chapter{Introduction}
|
||||
|
||||
This document contains various pieces of information that are useful for
|
||||
reference purposes.
|
||||
|
||||
\section{License Information}
|
||||
\input{../LICENSE}
|
||||
\subsection{Hold Music}
|
||||
Digium has licensed the music included with
|
||||
the Asterisk distribution From FreePlayMusic
|
||||
for use and distribution with Asterisk. It
|
||||
is licensed ONLY for use as hold music within
|
||||
an Asterisk based PBX.
|
||||
\section{Security}
|
||||
\input{security.tex}
|
||||
\section{Hardware}
|
||||
\input{hardware.tex}
|
||||
|
||||
\chapter{Configuration}
|
||||
\section{General Configuration Information}
|
||||
\subsection{Configuration Parser}
|
||||
\input{configuration.tex}
|
||||
\subsection{Asterisk.conf}
|
||||
\input{asterisk-conf.tex}
|
||||
\subsection{CLI Prompt}
|
||||
\input{cliprompt.tex}
|
||||
\subsection{Extensions}
|
||||
\input{extensions.tex}
|
||||
\subsection{IP Type of Service}
|
||||
\input{ip-tos.tex}
|
||||
\subsection{MP3 Support}
|
||||
\input{mp3.tex}
|
||||
\subsection{ICES}
|
||||
\input{ices.tex}
|
||||
\section{Database Support}
|
||||
\subsection{Realtime Database Configuration}
|
||||
\input{realtime.tex}
|
||||
\subsection{FreeTDS}
|
||||
\input{freetds.tex}
|
||||
\section{Privacy}
|
||||
\input{privacy.tex}
|
||||
|
||||
\chapter{Channel Variables}
|
||||
\input{channelvariables.tex}
|
||||
|
||||
\chapter{AEL, Asterisk Extension Language}
|
||||
\input{ael.tex}
|
||||
|
||||
\chapter{SLA (Shared Line Appearances)}
|
||||
\input{sla.tex}
|
||||
|
||||
\chapter{Channel Drivers}
|
||||
\section{IAX2}
|
||||
\input{chaniax.tex}
|
||||
\subsection{IAX2 Jitterbuffer}
|
||||
\input{jitterbuffer.tex}
|
||||
\section{mISDN}
|
||||
\input{misdn.tex}
|
||||
\section{Local}
|
||||
\input{localchannel.tex}
|
||||
|
||||
\chapter{Distributed Universal Number Discovery (DUNDi)}
|
||||
\section{Introduction}
|
||||
\input{dundi.tex}
|
||||
\section{Peering Agreement}
|
||||
\input{PEERING}
|
||||
|
||||
\chapter{ENUM}
|
||||
\input{enum.tex}
|
||||
|
||||
\chapter{AMI: Asterisk Manager Interface}
|
||||
\input{manager.tex}
|
||||
\input{ajam.tex}
|
||||
|
||||
\chapter{CDR: Call Detail Records}
|
||||
\input{billing.tex}
|
||||
\input{cdrdriver.tex}
|
||||
|
||||
\chapter{Voicemail}
|
||||
\section{ODBC Storage}
|
||||
\input{odbcstorage.tex}
|
||||
\section{IMAP Storage}
|
||||
\input{imapstorage.tex}
|
||||
|
||||
\chapter{SMS}
|
||||
\input{app-sms.tex}
|
||||
|
||||
\chapter{Queues}
|
||||
\input{queues-with-callback-members.tex}
|
||||
\section{Queue Logs}
|
||||
\input{queuelog.tex}
|
||||
|
||||
% Generate this using the "core dumpappdocs" CLI command that is present
|
||||
% when Asterisk is built with dev-mode enabled.
|
||||
\chapter{Application Reference}
|
||||
\input{ast_appdocs.tex}
|
||||
|
||||
% This is a list of files not yet integrated into this document:
|
||||
%
|
||||
%Misc
|
||||
%----
|
||||
%asterisk-mib.txt SNMP mib for Asterisk (net-snmp)
|
||||
%digium-mib.txt SNMP mib for Asterisk (net-snmp)
|
||||
%
|
||||
%For developers
|
||||
%--------------
|
||||
%See http://www.asterisk.org/developers for more information
|
||||
%
|
||||
%backtrace.txt How to produce a backtrace when Asterisk crashes
|
||||
%CODING-GUIDELINES Guidelines for developers
|
||||
%externalivr.txt Documentation of the protocol used in externalivr()
|
||||
%modules.txt How Asterisk modules work
|
||||
%datastores.txt About channel data stores
|
||||
%speechrec.txt The Generic Speech Recognition API
|
||||
|
||||
\enddocument
|
@ -1,87 +0,0 @@
|
||||
\section{Applications}
|
||||
|
||||
\begin{itemize}
|
||||
\item SetAccount - Set account code for billing
|
||||
\item SetAMAFlags - Sets AMA flags
|
||||
\item NoCDR - Make sure no CDR is saved for a specific call
|
||||
\item ResetCDR - Reset CDR
|
||||
\item ForkCDR - Save current CDR and start a new CDR for this call
|
||||
\item Authenticate - Authenticates and sets the account code
|
||||
\item SetCDRUserField - Set CDR user field
|
||||
\item AppendCDRUserField - Append data to CDR User field
|
||||
\end{itemize}
|
||||
|
||||
For more information, use the "core show application <application>" command.
|
||||
You can set default account codes and AMA flags for devices in
|
||||
channel configuration files, like sip.conf, iax.conf etc.
|
||||
|
||||
|
||||
\section{Fields of the CDR in Asterisk}
|
||||
|
||||
\begin{itemize}
|
||||
\item accountcode: What account number to use, (string, 20 characters)
|
||||
\item src: Caller*ID number (string, 80 characters)
|
||||
\item dst: Destination extension (string, 80 characters)
|
||||
\item dcontext: Destination context (string, 80 characters)
|
||||
\item clid: Caller*ID with text (80 characters)
|
||||
\item channel: Channel used (80 characters)
|
||||
\item dstchannel: Destination channel if appropriate (80 characters)
|
||||
\item lastapp: Last application if appropriate (80 characters)
|
||||
\item lastdata: Last application data (arguments) (80 characters)
|
||||
\item start: Start of call (date/time)
|
||||
\item answer: Answer of call (date/time)
|
||||
\item end: End of call (date/time)
|
||||
\item duration: Total time in system, in seconds (integer), from dial to hangup
|
||||
\item billsec: Total time call is up, in seconds (integer), from answer to hangup
|
||||
\item disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY
|
||||
\item amaflags: What flags to use: DOCUMENTATION, BILL, IGNORE etc,
|
||||
specified on a per channel basis like accountcode.
|
||||
\item user field: A user-defined field, maximum 255 characters
|
||||
\end{itemize}
|
||||
|
||||
In some cases, uniqueid is appended:
|
||||
|
||||
\begin{itemize}
|
||||
\item uniqueid: Unique Channel Identifier (32 characters)
|
||||
This needs to be enabled in the source code at compile time
|
||||
\end{itemize}
|
||||
|
||||
NOTE: If you use IAX2 channels for your calls, and allow 'full' transfers
|
||||
(not media-only transfers), then when the calls is transferred the server
|
||||
in the middle will no longer be involved in the signaling path, and thus
|
||||
will not generate accurate CDRs for that call. If you can, use media-only
|
||||
transfers with IAX2 to avoid this problem, or turn off transfers completely
|
||||
(although this can result in a media latency increase since the media packets
|
||||
have to traverse the middle server(s) in the call).
|
||||
|
||||
\section{CDR Variables}
|
||||
|
||||
If the channel has a cdr, that cdr record has its own set of variables which
|
||||
can be accessed just like channel variables. The following builtin variables
|
||||
are available.
|
||||
|
||||
\begin{verbatim}
|
||||
${CDR(clid)} Caller ID
|
||||
${CDR(src)} Source
|
||||
${CDR(dst)} Destination
|
||||
${CDR(dcontext)} Destination context
|
||||
${CDR(channel)} Channel name
|
||||
${CDR(dstchannel)} Destination channel
|
||||
${CDR(lastapp)} Last app executed
|
||||
${CDR(lastdata)} Last app's arguments
|
||||
${CDR(start)} Time the call started.
|
||||
${CDR(answer)} Time the call was answered.
|
||||
${CDR(end)} Time the call ended.
|
||||
${CDR(duration)} Duration of the call.
|
||||
${CDR(billsec)} Duration of the call once it was answered.
|
||||
${CDR(disposition)} ANSWERED, NO ANSWER, BUSY
|
||||
${CDR(amaflags)} DOCUMENTATION, BILL, IGNORE etc
|
||||
${CDR(accountcode)} The channel's account code.
|
||||
${CDR(uniqueid)} The channel's unique id.
|
||||
${CDR(userfield)} The channels uses specified field.
|
||||
\end{verbatim}
|
||||
|
||||
In addition, you can set your own extra variables by using Set(CDR(name)=value).
|
||||
These variables can be output into a text-format CDR by using the cdr\_custom
|
||||
CDR driver; see the cdr\_custom.conf.sample file in the configs directory for
|
||||
an example of how to do this.
|
@ -0,0 +1,105 @@
|
||||
Asterisk billing support - Call Detail Records
|
||||
----------------------------------------------
|
||||
Asterisk generates Call Detail Records in a database or in a comma
|
||||
separated text file.
|
||||
|
||||
* cdr_csv supports comma separated text file storage, this is the
|
||||
default driver
|
||||
* cdr_manager supports CDR information via the AMI, The Asterisk Manager
|
||||
interface
|
||||
* cdr_odbc supports UnixODBC databases, see http://www.unixodbc.org
|
||||
for an updated list of supported databases, from MySQL to MsSQL
|
||||
and text files.
|
||||
* cdr_tds supports FreeTDS databases (Among them MS SQL)
|
||||
NOTE: Please read doc/freetds.txt for information on possible
|
||||
problems with the FreeTDS driver
|
||||
* cdr_sqlite supports SQlite
|
||||
* cdr_pgsql supports PostgreSQL
|
||||
|
||||
In the asterisk-addons subversion repository, there's a cdr_mysql driver for
|
||||
MySQL.
|
||||
|
||||
Applications
|
||||
------------
|
||||
|
||||
* SetAccount Set account code for billing
|
||||
* SetAMAFlags Sets AMA flags
|
||||
* NoCDR Make sure no CDR is saved for a specific call
|
||||
* ResetCDR Reset CDR
|
||||
* ForkCDR Save current CDR and start a new CDR for this call
|
||||
* Authenticate Authenticates and sets the account code
|
||||
* SetCDRUserField Set CDR user field
|
||||
* AppendCDRUserField Append data to CDR User field
|
||||
|
||||
For more information, use the "show application" command.
|
||||
You can set default account codes and AMA flags for devices in
|
||||
channel configuration files, like sip.conf, iax.conf etc.
|
||||
|
||||
|
||||
Fields of the CDR in Asterisk
|
||||
-----------------------------
|
||||
|
||||
1. accountcode: What account number to use, (string, 20 characters)
|
||||
2. src: Caller*ID number (string, 80 characters)
|
||||
3. dst: Destination extension (string, 80 characters)
|
||||
4. dcontext: Destination context (string, 80 characters)
|
||||
5. clid: Caller*ID with text (80 characters)
|
||||
6. channel: Channel used (80 characters)
|
||||
7. dstchannel: Destination channel if appropriate (80 characters)
|
||||
8. lastapp: Last application if appropriate (80 characters)
|
||||
9. lastdata: Last application data (arguments) (80 characters)
|
||||
10. start: Start of call (date/time)
|
||||
11. answer: Answer of call (date/time)
|
||||
12. end: End of call (date/time)
|
||||
13. duration: Total time in system, in seconds (integer), from dial to hangup
|
||||
14. billsec: Total time call is up, in seconds (integer), from answer to hangup
|
||||
15. disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY
|
||||
16. amaflags: What flags to use: DOCUMENTATION, BILL, IGNORE etc,
|
||||
specified on a per channel basis like accountcode.
|
||||
17. user field: A user-defined field, maximum 255 characters
|
||||
|
||||
In some cases, uniqueid is appended:
|
||||
|
||||
* uniqueid: Unique Channel Identifier (32 characters)
|
||||
This needs to be enabled in the source code at compile time
|
||||
|
||||
|
||||
NOTE: If you use IAX2 channels for your calls, and allow 'full' transfers
|
||||
(not media-only transfers), then when the calls is transferred the server
|
||||
in the middle will no longer be involved in the signaling path, and thus
|
||||
will not generate accurate CDRs for that call. If you can, use media-only
|
||||
transfers with IAX2 to avoid this problem, or turn off transfers completely
|
||||
(although this can result in a media latency increase since the media packets
|
||||
have to traverse the middle server(s) in the call).
|
||||
|
||||
____________________________________
|
||||
CDR Variables
|
||||
------------------------------------
|
||||
|
||||
If the channel has a cdr, that cdr record has its own set of variables which
|
||||
can be accessed just like channel variables. The following builtin variables
|
||||
are available.
|
||||
|
||||
${CDR(clid)} Caller ID
|
||||
${CDR(src)} Source
|
||||
${CDR(dst)} Destination
|
||||
${CDR(dcontext)} Destination context
|
||||
${CDR(channel)} Channel name
|
||||
${CDR(dstchannel)} Destination channel
|
||||
${CDR(lastapp)} Last app executed
|
||||
${CDR(lastdata)} Last app's arguments
|
||||
${CDR(start)} Time the call started.
|
||||
${CDR(answer)} Time the call was answered.
|
||||
${CDR(end)} Time the call ended.
|
||||
${CDR(duration)} Duration of the call.
|
||||
${CDR(billsec)} Duration of the call once it was answered.
|
||||
${CDR(disposition)} ANSWERED, NO ANSWER, BUSY
|
||||
${CDR(amaflags)} DOCUMENTATION, BILL, IGNORE etc
|
||||
${CDR(accountcode)} The channel's account code.
|
||||
${CDR(uniqueid)} The channel's unique id.
|
||||
${CDR(userfield)} The channels uses specified field.
|
||||
|
||||
In addition, you can set your own extra variables by using Set(CDR(name)=value).
|
||||
These variables can be output into a text-format CDR by using the cdr_custom
|
||||
CDR driver; see the cdr_custom.conf.sample file in the configs directory for
|
||||
an example of how to do this.
|
@ -0,0 +1,18 @@
|
||||
Caller ID presentation values
|
||||
-----------------------------
|
||||
|
||||
In some channels it is possible to set Caller ID presentation for a device. It is
|
||||
also possible to set the presentation for an active channel in the dial plan
|
||||
with the setcallerpres() application.
|
||||
|
||||
Valid values are:
|
||||
|
||||
allowed_not_screened : Presentation Allowed, Not Screened
|
||||
allowed_passed_screen : Presentation Allowed, Passed Screen
|
||||
allowed_failed_screen : Presentation Allowed, Failed Screen
|
||||
allowed : Presentation Allowed, Network Number
|
||||
prohib_not_screened : Presentation Prohibited, Not Screened
|
||||
prohib_passed_screen : Presentation Prohibited, Passed Screen
|
||||
prohib_failed_screen : Presentation Prohibited, Failed Screen
|
||||
prohib : Presentation Prohibited, Network Number
|
||||
unavailable : Number Unavailable
|
@ -1,431 +0,0 @@
|
||||
Call data records can be stored in many different databases or even CSV text.
|
||||
|
||||
\section{MSSQL}
|
||||
|
||||
Asterisk can currently store CDRs into an MSSQL database in
|
||||
two different ways: cdr\_odbc or cdr\_tds
|
||||
|
||||
Call Data Records can be stored using unixODBC (which requires
|
||||
the FreeTDS package) [cdr\_odbc] or directly by using just the
|
||||
FreeTDS package [cdr\_tds] The following provide some
|
||||
examples known to get asterisk working with mssql.
|
||||
|
||||
NOTE: Only choose one db connector.
|
||||
|
||||
\subsection{ODBC using cdr\_odbc}
|
||||
Compile, configure, and install the latest unixODBC package:
|
||||
\begin{verbatim}
|
||||
tar -zxvf unixODBC-2.2.9.tar.gz &&
|
||||
cd unixODBC-2.2.9 &&
|
||||
./configure --sysconfdir=/etc --prefix=/usr --disable-gui &&
|
||||
make &&
|
||||
make install
|
||||
\end{verbatim}
|
||||
|
||||
Compile, configure, and install the latest FreeTDS package:
|
||||
\begin{verbatim}
|
||||
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
|
||||
\end{verbatim}
|
||||
|
||||
Compile, or recompile, asterisk so that it will now add support
|
||||
for cdr\_odbc.
|
||||
\begin{verbatim}
|
||||
make clean && ./configure --with-odbc &&
|
||||
make update &&
|
||||
make &&
|
||||
make install
|
||||
\end{verbatim}
|
||||
|
||||
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{verbatim}
|
||||
/etc/odbcinst.ini
|
||||
[FreeTDS]
|
||||
Description = FreeTDS ODBC driver for MSSQL
|
||||
Driver = /usr/lib/libtdsodbc.so
|
||||
Setup = /usr/lib/libtdsS.so
|
||||
FileUsage = 1
|
||||
|
||||
/etc/odbc.ini
|
||||
[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
|
||||
\end{verbatim}
|
||||
|
||||
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
|
||||
\begin{verbatim}
|
||||
[ -f /etc/asterisk/cdr_tds.conf ] > /etc/asterisk/cdr_tds.conf
|
||||
\end{verbatim}
|
||||
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{verbatim}
|
||||
/etc/asterisk/cdr_odbc.conf
|
||||
[global]
|
||||
dsn=MSSQL-asterisk
|
||||
username=voipdbuser
|
||||
password=voipdbpass
|
||||
loguniqueid=yes
|
||||
\end{verbatim}
|
||||
And finally, create the 'cdr' table in your mssql database.
|
||||
\begin{verbatim}
|
||||
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
|
||||
)
|
||||
\end{verbatim}
|
||||
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{verbatim}
|
||||
tar -zxvf freetds-0.62.4.tar.gz &&
|
||||
cd freetds-0.62.4 &&
|
||||
./configure --prefix=/usr --with-tdsver=7.0
|
||||
make &&
|
||||
make install
|
||||
\end{verbatim}
|
||||
Compile, or recompile, asterisk so that it will now add support
|
||||
for cdr\_tds.
|
||||
\begin{verbatim}
|
||||
make clean && ./configure --with-tds &&
|
||||
make update &&
|
||||
make &&
|
||||
make install
|
||||
\end{verbatim}
|
||||
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{verbatim}
|
||||
[ -f /etc/asterisk/cdr_odbc.conf ] > /etc/asterisk/cdr_odbc.conf
|
||||
\end{verbatim}
|
||||
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{verbatim}
|
||||
/etc/asterisk/cdr_tds.conf
|
||||
[global]
|
||||
hostname=192.168.1.25
|
||||
port=1433
|
||||
dbname=voipdb
|
||||
user=voipdbuser
|
||||
password=voipdpass
|
||||
charset=BIG5
|
||||
\end{verbatim}
|
||||
And finally, create the 'cdr' table in your mssql database.
|
||||
\begin{verbatim}
|
||||
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
|
||||
)
|
||||
\end{verbatim}
|
||||
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.
|
||||
|
||||
|
||||
\section{MYSQL}
|
||||
|
||||
Using MySQL for CDR records is supported by using ODBC and the cdr\_odbc module.
|
||||
|
||||
\section{PGSQL}
|
||||
If you want to go directly to postgresql database, and have the cdr\_pgsql.so
|
||||
compiled you can use the following sample setup.
|
||||
On Debian, before compiling asterisk, just install libpqxx-dev.
|
||||
Other distros will likely have a similiar package.
|
||||
|
||||
Once you have the compile done,
|
||||
copy the sample cdr\_pgsql.conf file or create your own.
|
||||
|
||||
Here is a sample:
|
||||
\begin{verbatim}
|
||||
/etc/asterisk/cdr_pgsql.conf
|
||||
; Sample Asterisk config file for CDR logging to PostgresSQL
|
||||
[global]
|
||||
hostname=localhost
|
||||
port=5432
|
||||
dbname=asterisk
|
||||
password=password
|
||||
user=postgres
|
||||
table=cdr
|
||||
\end{verbatim}
|
||||
Now create a table in postgresql for your cdrs
|
||||
|
||||
\begin{verbatim}
|
||||
CREATE TABLE cdr (
|
||||
calldate time 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
|
||||
);
|
||||
\end{verbatim}
|
||||
|
||||
\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}
|
||||
Installation:
|
||||
\begin{verbatim}
|
||||
Download the sources from:
|
||||
|
||||
http://developer.berlios.de/projects/radiusclient-ng/
|
||||
|
||||
Untar the source tarball.
|
||||
root@localhost:/usr/local/src# tar xvfz radiusclient-ng-0.5.2.tar.gz
|
||||
|
||||
Compile and install the library.
|
||||
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 /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.
|
||||
|
||||
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 /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.
|
||||
|
||||
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
|
||||
/usr/local/etc/radiusclient-ng/dictionary
|
||||
the line:
|
||||
\begin{verbatim}
|
||||
\$INCLUDE /path/to/dictionary.digium
|
||||
\end{verbatim}
|
||||
|
||||
\subsubsection{Install FreeRADIUS Server (Version 1.1.1)}
|
||||
|
||||
Download sources tarball from:
|
||||
|
||||
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 /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 /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 '/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
|
||||
/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 /include/asterisk/cdr.h
|
||||
for all the fields which are recorded. By default, records in comma
|
||||
separated values will be created in /var/log/asterisk/cdr-csv.
|
||||
|
||||
The configuration file for cdr\_radius.so module is :
|
||||
|
||||
/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}
|
@ -0,0 +1,215 @@
|
||||
Call data records can be stored in many different databases or even CSV text.
|
||||
|
||||
MSSQL: Asterisk can currently store CDRs into an MSSQL database in
|
||||
two different ways: cdr_odbc.c or cdr_tds.c
|
||||
|
||||
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.
|
||||
|
||||
ODBC [cdr_odbc.c]:
|
||||
Compile, configure, and install the latest unixODBC package:
|
||||
tar -zxvf unixODBC-2.2.9.tar.gz &&
|
||||
cd unixODBC-2.2.9 &&
|
||||
./configure --sysconfdir=/etc --prefix=/usr --disable-gui &&
|
||||
make &&
|
||||
make install
|
||||
|
||||
Compile, configure, and install the latest FreeTDS package:
|
||||
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
|
||||
|
||||
Compile, or recompile, asterisk so that it will now add support
|
||||
for cdr_odbc.c
|
||||
|
||||
make clean &&
|
||||
make update &&
|
||||
make &&
|
||||
make install
|
||||
|
||||
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.
|
||||
|
||||
/etc/odbcinst.ini
|
||||
[FreeTDS]
|
||||
Description = FreeTDS ODBC driver for MSSQL
|
||||
Driver = /usr/lib/libtdsodbc.so
|
||||
Setup = /usr/lib/libtdsS.so
|
||||
FileUsage = 1
|
||||
|
||||
/etc/odbc.ini
|
||||
[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
|
||||
|
||||
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
|
||||
|
||||
[ -f /etc/asterisk/cdr_tds.conf ] > /etc/asterisk/cdr_tds.conf
|
||||
|
||||
NOTE: unixODBC requires the freeTDS package, but asterisk does
|
||||
not call freeTDS directly.
|
||||
|
||||
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.
|
||||
|
||||
/etc/asterisk/cdr_odbc.conf
|
||||
[global]
|
||||
dsn=MSSQL-asterisk
|
||||
username=voipdbuser
|
||||
password=voipdbpass
|
||||
loguniqueid=yes
|
||||
|
||||
And finally, create the 'cdr' table in your mssql database.
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
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.
|
||||
|
||||
TDS [cdr_tds.c]:
|
||||
Compile, configure, and install the latest FreeTDS package:
|
||||
tar -zxvf freetds-0.62.4.tar.gz &&
|
||||
cd freetds-0.62.4 &&
|
||||
./configure --prefix=/usr --with-tdsver=7.0
|
||||
make &&
|
||||
make install
|
||||
|
||||
Compile, or recompile, asterisk so that it will now add support
|
||||
for cdr_tds.c
|
||||
|
||||
make clean &&
|
||||
make update &&
|
||||
make &&
|
||||
make install
|
||||
|
||||
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
|
||||
|
||||
[ -f /etc/asterisk/cdr_odbc.conf ] > /etc/asterisk/cdr_odbc.conf
|
||||
|
||||
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.
|
||||
|
||||
/etc/asterisk/cdr_tds.conf
|
||||
[global]
|
||||
hostname=192.168.1.25
|
||||
port=1433
|
||||
dbname=voipdb
|
||||
user=voipdbuser
|
||||
password=voipdpass
|
||||
charset=BIG5
|
||||
|
||||
And finally, create the 'cdr' table in your mssql database.
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
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.
|
||||
|
||||
|
||||
MYSQL:
|
||||
|
||||
|
||||
PGSQL:
|
||||
If you want to go directly to postgresql database, and have the cdr_pgsql.so
|
||||
compiled you can use the following sample setup.
|
||||
On Debian, before compiling asterisk, just install libpqxx-dev.
|
||||
Other distros will likely have a similiar package.
|
||||
|
||||
Once you have the compile done,
|
||||
copy the sample cdr_pgsql.conf file or create your own.
|
||||
|
||||
Here is a sample:
|
||||
|
||||
/etc/asterisk/cdr_pgsql.conf
|
||||
; Sample Asterisk config file for CDR logging to PostgresSQL
|
||||
[global]
|
||||
hostname=localhost
|
||||
port=5432
|
||||
dbname=asterisk
|
||||
password=password
|
||||
user=postgres
|
||||
table=cdr
|
||||
|
||||
;Now create a table in postgresql for your cdrs
|
||||
|
||||
;SQL table where CDRs will be inserted
|
||||
;Copy and paste this into your postgresql prompt.
|
||||
CREATE TABLE cdr (
|
||||
calldate time 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
|
||||
);
|
||||
|
||||
|
||||
SQLLITE:
|
||||
|
||||
|
||||
RADIUS: See doc/radius.txt for more information on cdr_radius
|
@ -1,84 +0,0 @@
|
||||
\subsection{Introduction}
|
||||
|
||||
This section is intended as an introduction to the Inter-Asterisk
|
||||
eXchange v2 (or simply IAX2) protocol. It provides both a theoretical
|
||||
background and practical information on its use.
|
||||
|
||||
\subsection{Why IAX2?}
|
||||
|
||||
The first question most people are thinking at this point is "Why do you
|
||||
need another VoIP protocol? Why didn't you just use SIP or H.323?"
|
||||
|
||||
Well, the answer is a fairly complicated one, but in a nutshell it's like
|
||||
this... Asterisk is intended as a very flexible and powerful
|
||||
communications tool. As such, the primary feature we need from a VoIP
|
||||
protocol is the ability to meet our own goals with Asterisk, and one with
|
||||
enough flexibility that we could use it as a kind of laboratory for
|
||||
inventing and implementing new concepts in the field. Neither H.323 or
|
||||
SIP fit the roles we needed, so we developed our own protocol, which,
|
||||
while not standards based, provides a number of advantages over both SIP
|
||||
and H.323, some of which are:
|
||||
|
||||
\begin{itemize}
|
||||
\item Interoperability with NAT/PAT/Masquerade firewalls
|
||||
\begin{itemize}
|
||||
\item IAX seamlessly interoperates through all sorts of NAT and PAT
|
||||
and other firewalls, including the ability to place and
|
||||
receive calls, and transfer calls to other stations.
|
||||
\end{itemize}
|
||||
\item High performance, low overhead protocol
|
||||
\begin{itemize}
|
||||
\item When running on low-bandwidth connections, or when running
|
||||
large numbers of calls, optimized bandwidth utilization is
|
||||
imperative. IAX uses only 4 bytes of overhead
|
||||
\end{itemize}
|
||||
\item Internationalization support
|
||||
\begin{itemize}
|
||||
\item IAX transmits language information, so that remote PBX
|
||||
content can be delivered in the native language of the
|
||||
calling party.
|
||||
\end{itemize}
|
||||
\item Remote dialplan polling
|
||||
\begin{itemize}
|
||||
\item IAX allows a PBX or IP phone to poll the availability of a
|
||||
number from a remote server. This allows PBX dialplans to
|
||||
be centralized.
|
||||
\end{itemize}
|
||||
\item Flexible authentication
|
||||
\begin{itemize}
|
||||
\item IAX supports cleartext, md5, and RSA authentication,
|
||||
providing flexible security models for outgoing calls and
|
||||
registration services.
|
||||
\end{itemize}
|
||||
\item Multimedia protocol
|
||||
\begin{itemize}
|
||||
\item IAX supports the transmission of voice, video, images, text,
|
||||
HTML, DTMF, and URL's. Voice menus can be presented in both
|
||||
audibly and visually.
|
||||
\end{itemize}
|
||||
\item Call statistic gathering
|
||||
\begin{itemize}
|
||||
\item IAX gathers statistics about network performance (including
|
||||
latency and jitter, as well as providing end-to-end latency
|
||||
measurement.
|
||||
\end{itemize}
|
||||
\item Call parameter communication
|
||||
\begin{itemize}
|
||||
\item Caller*ID, requested extension, requested context, etc are
|
||||
all communicated through the call.
|
||||
\end{itemize}
|
||||
\item Single socket design
|
||||
\begin{itemize}
|
||||
\item IAX's single socket design allows up to 32768 calls to be
|
||||
multiplexed.
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
While we value the importance of standards based (i.e. SIP) call handling,
|
||||
hopefully this will provide a reasonable explanation of why we developed
|
||||
IAX rather than starting with SIP.
|
||||
|
||||
\subsection{Configuration}
|
||||
|
||||
For examples of a configuration, please see the iax.conf.sample in
|
||||
your the /configs directory of you source code distribution.
|
@ -0,0 +1,369 @@
|
||||
Inter-Asterisk eXchange Protocol
|
||||
================================
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
This document is intended as an introduction to the Inter-Asterisk
|
||||
eXchange (or simply IAX) protocol. It provides both a theoretical
|
||||
background and practical information on its use.
|
||||
|
||||
WHY IAX
|
||||
-------
|
||||
The first question most people are thinking at this point is "Why do you
|
||||
need another VoIP protocol? Why didn't you just use SIP or H.323?"
|
||||
|
||||
Well, the answer is a fairly complicated one, but in a nutshell it's like
|
||||
this... Asterisk is intended as a very flexible and powerful
|
||||
communications tool. As such, the primary feature we need from a VoIP
|
||||
protocol is the ability to meet our own goals with Asterisk, and one with
|
||||
enough flexibility that we could use it as a kind of laboratory for
|
||||
inventing and implementing new concepts in the field. Neither H.323 or
|
||||
SIP fit the roles we needed, so we developed our own protocol, which,
|
||||
while not standards based, provides a number of advantages over both SIP
|
||||
and H.323, some of which are:
|
||||
|
||||
* Interoperability with NAT/PAT/Masquerade firewalls
|
||||
IAX seamlessly interoperates through all sorts of NAT and PAT
|
||||
and other firewalls, including the ability to place and
|
||||
receive calls, and transfer calls to other stations.
|
||||
|
||||
* High performance, low overhead protocol
|
||||
When running on low-bandwidth connections, or when running
|
||||
large numbers of calls, optimized bandwidth utilization is
|
||||
imperative. IAX uses only 4 bytes of overhead
|
||||
|
||||
* Internationalization support
|
||||
IAX transmits language information, so that remote PBX
|
||||
content can be delivered in the native language of the
|
||||
calling party.
|
||||
|
||||
* Remote dialplan polling
|
||||
IAX allows a PBX or IP phone to poll the availability of a
|
||||
number from a remote server. This allows PBX dialplans to
|
||||
be centralized.
|
||||
|
||||
* Flexible authentication
|
||||
IAX supports cleartext, md5, and RSA authentication,
|
||||
providing flexible security models for outgoing calls and
|
||||
registration services.
|
||||
|
||||
* Multimedia protocol
|
||||
IAX supports the transmission of voice, video, images, text,
|
||||
HTML, DTMF, and URL's. Voice menus can be presented in both
|
||||
audibly and visually.
|
||||
|
||||
* Call statistic gathering
|
||||
IAX gathers statistics about network performance (including
|
||||
latency and jitter, as well as providing end-to-end latency
|
||||
measurement.
|
||||
|
||||
* Call parameter communication
|
||||
Caller*ID, requested extension, requested context, etc are
|
||||
all communicated through the call.
|
||||
|
||||
* Single socket design
|
||||
IAX's single socket design allows up to 32768 calls to be
|
||||
multiplexed.
|
||||
|
||||
While we value the importance of standards based (i.e. SIP) call handling,
|
||||
hopefully this will provide a reasonable explanation of why we developed
|
||||
IAX rather than starting with SIP.
|
||||
|
||||
CONFIG FILE CONVENTIONS
|
||||
-----------------------
|
||||
Lines beginning with '>' represent lines which might appear in an actual
|
||||
configuration file. The '>' is used to help separate them from the
|
||||
descriptive text and should not actually be included in the file itself.
|
||||
|
||||
Lines within []'s by themselves represent section labels within the
|
||||
configuration file. like this:
|
||||
|
||||
> [mysection]
|
||||
|
||||
Options are set using the "=" sign, for example
|
||||
|
||||
> myoption = value
|
||||
|
||||
Sometimes an option will have a number of discrete values which it can
|
||||
take. In that case, in the documentation, the options will be listed
|
||||
within square brackets (the "[" and "]" ones) separated by the pipe symbol
|
||||
("|"). For example:
|
||||
|
||||
> myoption = [value1|value2|value3]
|
||||
|
||||
means the option "myoption" can be assigned a value of "value1", "value2",
|
||||
or "value3".
|
||||
|
||||
Objects, or pseudo-objects are instantiated using the "=>" construct. For
|
||||
example:
|
||||
|
||||
> myobject => parameter
|
||||
|
||||
creates an object called "myobject" with some parameter whose definition
|
||||
would be specific to that object. Note that the config file parser
|
||||
considers "=>" and "=" to be equivalent and their use is purely to make
|
||||
configuration files more readable and easier to "humanly parse".
|
||||
|
||||
The comment character in Asterisk configuration files is the semicolon
|
||||
";". The reason it is not "#" is because the "#" symbol can be used as
|
||||
parts of extensions and it didn't seem like a good idea to have to escape
|
||||
it.
|
||||
|
||||
IAX CONFIGURATION IN ASTERISK
|
||||
-----------------------------
|
||||
|
||||
Like everything else in Asterisk, IAX's configuration lies in
|
||||
/etc/asterisk -- specifically /etc/asterisk/iax.conf
|
||||
|
||||
The IAX configuration file is a collection of sections, each of which
|
||||
(with the exception of the "general" section) represents an entity within
|
||||
the IAX scope.
|
||||
|
||||
------------
|
||||
|
||||
The first section is typically the "general" section. In this area,
|
||||
a number of parameters which affect the entire system are configured.
|
||||
Specifically, the default codecs, port and address, jitter behavior, TOS
|
||||
bits, and registrations.
|
||||
|
||||
The first line of the "general" section is always:
|
||||
|
||||
> [general]
|
||||
|
||||
Following the first line are a number of other possibilities:
|
||||
|
||||
> bindport = <portnum>
|
||||
|
||||
This sets the port that IAX will bind to. The default IAX version 1
|
||||
port number is 5036. For IAX version 2, that is now the default in
|
||||
Asterisk, the default port is 4569.
|
||||
It is recommended that this value not be altered in general.
|
||||
|
||||
> bindaddr = <ipaddr>
|
||||
|
||||
This allows you to bind IAX to a specific local IP address instead of
|
||||
binding to all addresses. This could be used to enhance security if, for
|
||||
example, you only wanted IAX to be available to users on your LAN.
|
||||
|
||||
> bandwidth = [low|medium|high]
|
||||
|
||||
The bandwidth selection initializes the codec selection to appropriate
|
||||
values for given bandwidths. The "high" selection enables all codecs and
|
||||
is recommended only for 10Mbps or higher connections. The "medium"
|
||||
bandwidth eliminates signed linear, Mu-law and A-law codecs, leaving only
|
||||
the codecs which are 32kbps and smaller (with MP3 as a special case). It
|
||||
can be used with broadband connections if desired. "low" eliminates ADPCM
|
||||
and MP3 formats, leaving only the G.723.1, GSM, and LPC10.
|
||||
|
||||
> allow = [gsm|lpc10|g723.1|adpcm|ulaw|alaw|mp3|slinear|all]
|
||||
> disallow = [gsm|lpc10|g723.1|adpcm|ulaw|alaw|mp3|slinear|all]
|
||||
|
||||
The "allow" and "disallow" allow you to fine tune the codec selection
|
||||
beyond the initial bandwidth selection on a codec-by-codec basis.
|
||||
|
||||
The recommended configuration is to select "low" bandwidth and then
|
||||
disallow the LPC10 codec just because it doesn't sound very good.
|
||||
|
||||
> jitterbuffer = [yes|no]
|
||||
> dropcount = <dropamount>
|
||||
> maxjitterbuffer = <max>
|
||||
> maxexcessbuffer = <max>
|
||||
|
||||
These parameters control the operation of the jitter buffer. The
|
||||
jitterbuffer should always be enabled unless you expect all your
|
||||
connections to be over a LAN.
|
||||
* drop count is the maximum number of voice packets to allow to drop
|
||||
(out of 100). Useful values are 3-10.
|
||||
* maxjitterbuffer is the maximum amount of jitter buffer to permit to be
|
||||
used.
|
||||
* maxexcessbuffer is the maximum amount of excess jitter buffer
|
||||
that is permitted before the jitter buffer is slowly shrunk to eliminate
|
||||
latency.
|
||||
* minexcessbuffer is the minimum amount of excess jitter buffer
|
||||
|
||||
> accountcode = <code>
|
||||
> amaflags = [default|omit|billing|documentation]
|
||||
|
||||
These parameters affect call detail record generation. The first sets the
|
||||
account code for records received with IAX. The account code can be
|
||||
overridden on a per-user basis for incoming calls (see below). The
|
||||
amaflags controls how the record is labeled ("omit" causes no record to be
|
||||
written. "billing" and "documentation" label the records as billing or
|
||||
documentation records respectively, and "default" selects the system
|
||||
default.
|
||||
|
||||
> tos = [lowdelay|throughput|reliability|mincost|none]
|
||||
|
||||
IAX can optionally set the TOS (Type of Service) bits to specified values
|
||||
to help improve performance in routing. The recommended value is
|
||||
"lowdelay", which many routers (including any Linux routers with 2.4
|
||||
kernels that have not been altered with ip tables) will give priority to
|
||||
these packets, improving voice quality.
|
||||
|
||||
> register => <name>[:<secret>]@<host>[:port]
|
||||
|
||||
Any number of registry entries may be instantiated in the general
|
||||
section. Registration allows Asterisk to notify a remote Asterisk server
|
||||
(with a fixed address) what our current address is. In order for
|
||||
registration to work, the remote Asterisk server will need to have a
|
||||
dynamic peer entry with the same name (and secret if provided).
|
||||
|
||||
The name is a required field, and is the remote peer name that we wish to
|
||||
identify ourselves as. A secret may be provided as well. The secret is
|
||||
generally a shared password between the local server and the remote
|
||||
server. However, if the secret is in square brackets ([]'s) then it is
|
||||
interpreted as the name of a RSA key to use. In that case, the local Asterisk
|
||||
server must have the *private* key (/var/lib/asterisk/keys/<name>.key) and
|
||||
the remote server will have to have the corresponding public key.
|
||||
|
||||
The "host" is a required field and is the hostname or IP address of the
|
||||
remote Asterisk server. The port specification is optional and is by
|
||||
default 4569 for iax2 if not specified.
|
||||
|
||||
> notransfer = yes | no
|
||||
|
||||
If an IAX phone calls another IAX phone by using a Asterisk server,
|
||||
Asterisk will transfer the call to go peer to peer. If you do not
|
||||
want this, turn on notransfer with a "yes". This is also settable
|
||||
for peers and users.
|
||||
|
||||
-------------
|
||||
|
||||
The following sections, after "general" define either users, peers or
|
||||
friends. A "user" is someone who connects to us. A "peer" is someone
|
||||
that we connect to. A "friend" is simply shorthand for creating a "user"
|
||||
and "peer" with identical parameters (i.e. someone who can contact us and
|
||||
who we contact).
|
||||
|
||||
> [identifier]
|
||||
|
||||
The section begins with the identifier in square brackets. The identifier
|
||||
should be an alphanumeric string.
|
||||
|
||||
> type = [user|peer|friend]
|
||||
|
||||
This line tells Asterisk how to interpret this entity. Users are things
|
||||
that connect to us, while peers are phones we connect to, and a friend is
|
||||
shorthand for creating a user and a peer with identical information
|
||||
|
||||
----------------
|
||||
User fields:
|
||||
|
||||
> context = <context>
|
||||
|
||||
One or more context lines may be specified in a user, thus giving the user
|
||||
access to place calls in the given contexts. Contexts are used by
|
||||
Asterisk to divide dialing plans into logical units each with the ability
|
||||
to have numbers interpreted differently, have their own security model,
|
||||
auxiliary switch handling, and include other contexts. Most users are
|
||||
given access to the default context. Trusted users could be given access
|
||||
to the local context for example.
|
||||
|
||||
> permit = <ipaddr>/<netmask>
|
||||
> deny = <ipaddr>/<netmask>
|
||||
|
||||
Permit and deny rules may be applied to users, allowing them to connect
|
||||
from certain IP addresses and not others. The permit and deny rules are
|
||||
interpreted in sequence and all are evaluated on a given IP address, with
|
||||
the final result being the decision. For example:
|
||||
|
||||
> permit = 0.0.0.0/0.0.0.0
|
||||
> deny = 192.168.0.0/255.255.255.0
|
||||
|
||||
would deny anyone in 192.168.0.0 with a netmask of 24 bits (class C),
|
||||
whereas:
|
||||
|
||||
> deny = 192.168.0.0/24
|
||||
> permit = 0.0.0.0/0
|
||||
|
||||
would not deny anyone since the final rule would permit anyone, thus
|
||||
overriding the denial.
|
||||
|
||||
If no permit/deny rules are listed, it is assumed that someone may connect
|
||||
from anywhere.
|
||||
|
||||
> callerid = <callerid>
|
||||
|
||||
You may override the Caller*ID information passed by a user to you (if
|
||||
they choose to send it) in order that it always be accurate from the
|
||||
perspective of your server.
|
||||
|
||||
> auth = [md5|plaintext|rsa]
|
||||
|
||||
You may select which authentication methods are permitted to be used by
|
||||
the user to authenticate to us. Multiple methods may be specified,
|
||||
separated by commas. If md5 or plaintext authentication is selected, a
|
||||
secret must be provided. If RSA authentication is specified, then one or
|
||||
more key names must be specified with "inkeys"
|
||||
|
||||
If no secret is specified and no authentication method is specified, then
|
||||
no authentication will be required.
|
||||
|
||||
> secret = <secret>
|
||||
|
||||
The "secret" line specifies the shared secret for md5 and plaintext
|
||||
authentication methods. It is never suggested to use plaintext except in
|
||||
some cases for debugging.
|
||||
|
||||
> inkeys = key1[:key2...]
|
||||
|
||||
The "inkeys" line specifies which keys we can use to authenticate the
|
||||
remote peer. If the peer's challenge passes with any of the given keys,
|
||||
then we accept its authentication. The key files live in
|
||||
/var/lib/asterisk/keys/<name>.pub and are *public keys*. Public keys are
|
||||
not typically DES3 encrypted and thus do not usually need initialization.
|
||||
|
||||
---------------
|
||||
Peer configuration
|
||||
|
||||
> allow = [gsm|lpc10|g723.1|adpcm|ulaw|alaw|mp3|slinear|all]
|
||||
> disallow = [gsm|lpc10|g723.1|adpcm|ulaw|alaw|mp3|slinear|all]
|
||||
|
||||
The "allow" and "disallow" may be used to enable or disable specific codec
|
||||
support on a per-peer basis.
|
||||
|
||||
> host = [<ipaddr>|dynamic]
|
||||
|
||||
The host line specifies the hostname or IP address of the remote host, or
|
||||
may be the word "dynamic" signifying that the host will register with us
|
||||
(see register => in the general section above).
|
||||
|
||||
> defaultip = <ipaddr>
|
||||
|
||||
If the host uses dynamic registration, Asterisk may still be given a
|
||||
default IP address to use when dynamic registration has not been performed
|
||||
or has timed out.
|
||||
|
||||
> peercontext = <context>
|
||||
|
||||
Specifies the context name to be passed to the peer for it to use when routing
|
||||
the call through its dial plan. This entry will be used only if a context
|
||||
is not included in the IAX2 channel name passed to the Dial command.
|
||||
|
||||
> qualify = [yes | no | <value>]
|
||||
|
||||
Qualify turns on checking of availability of the remote peer. If the
|
||||
peer becomes unavailable, no calls are placed to the peer until
|
||||
it is reachable again. This is also helpful in certain NAT situations.
|
||||
|
||||
> jitterbuffer = [yes | no]
|
||||
|
||||
Turns on or off the jitterbuffer for this peer
|
||||
|
||||
> mailbox = <mailbox>[@mailboxcontext]
|
||||
|
||||
Specifies a mailbox to check for voicemail notification.
|
||||
|
||||
> permit = <ipaddr>/<netmask>
|
||||
> deny = <ipaddr>/<netmask>
|
||||
|
||||
Permit and deny rules may be applied to users, allowing them to connect
|
||||
from certain IP addresses and not others. The permit and deny rules are
|
||||
interpreted in sequence and all are evaluated on a given IP address, with
|
||||
the final result being the decision. See the user section above
|
||||
for examples.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
For more examples of a configuration, please see the iax.conf.sample in
|
||||
your the /configs directory of you source code distribution
|
@ -0,0 +1,44 @@
|
||||
Implementing a Channel
|
||||
======================
|
||||
|
||||
* What is a channel?
|
||||
|
||||
A channel is a unit which brings in a call to the Asterisk PBX. A channel
|
||||
could be connected to a real telephone (like the Internet Phone Jack) or
|
||||
to a logical call (like an Internet phone call). Asterisk makes no
|
||||
distinction between "FXO" and "FXS" style channels (that is, it doesn't
|
||||
distinguish between telephone lines and telephones).
|
||||
|
||||
Every call is placed or received on a distinct channel. Asterisk uses a
|
||||
channel driver (typically named chan_xxx.so) to support each type of
|
||||
hardware.
|
||||
|
||||
* What do I need to create a channel?
|
||||
|
||||
In order to support a new piece of hardware you need to write a channel
|
||||
driver. The easiest way to do so is to look at an existing channel driver
|
||||
and model your own code after it.
|
||||
|
||||
* What's the general architecture?
|
||||
|
||||
Typically, a channel reads a configuration file on startup which tells it
|
||||
something about the hardware it's going to be servicing. Then, it
|
||||
launches a thread which monitors all the idle channels (See the chan_modem
|
||||
or the chan_ixj for an example of this). When a "RING" or equivalent is
|
||||
detected, the monitoring thread should allocate a channel structure and
|
||||
assign all the callbacks to it (see ixj_new, for example), and then call
|
||||
ast_pbx_start on that channel. ast_pbx_start will launch a new thread to
|
||||
handle the channel as long as the call is up, so once pbx_start has
|
||||
successfully been run, the monitor should no longer monitor that channel.
|
||||
The PBX thread will use the channel, reading, writing, calling, etc., and
|
||||
multiplexing that channel with others using select() on the channel's
|
||||
file descriptor (if your channel doesn't have an associated file
|
||||
descriptor, you'll need to emulate one somehow, perhaps along the lines of
|
||||
what the translator API does with its channel.
|
||||
|
||||
When the PBX is finished with the line, it will hang up the line, at which
|
||||
point it the hardware should again be monitored by the monitoring thread.
|
||||
|
||||
---------------
|
||||
For more information, please consult the Asterisk Developer's Documentation
|
||||
on http://www.asterisk.org
|
@ -0,0 +1,9 @@
|
||||
Cygwin support is completely experimental and unsupported at this time. The
|
||||
current state of cygwin support is that it will compile, and start the cli,
|
||||
but will not yet take calls properly.
|
||||
|
||||
To compile with cygwin, you will need at least a standard base cygwin install plus the following packages:
|
||||
|
||||
minires
|
||||
minires-devel
|
||||
|
@ -0,0 +1,91 @@
|
||||
Asterisk external configuration
|
||||
===============================
|
||||
|
||||
The Asterisk external configuration engine is the result of work by
|
||||
Anthony Minessale II, Mark Spencer and Constantine Filin.
|
||||
|
||||
It is designed to provide a flexible, seamless integration between
|
||||
Asterisk's internal configuration structure and external SQL other other
|
||||
databases (maybe even LDAP one day).
|
||||
|
||||
The external configuration engine is the basis for the ARA, the
|
||||
Asterisk Realtime Architecture (see doc/realtime.txt for more
|
||||
information).
|
||||
|
||||
* Configuration
|
||||
|
||||
External configuration is configured in /etc/asterisk/extconfig.conf
|
||||
allowing you to map any configuration file (static mappings) to
|
||||
be pulled from the database, or to map special runtime entries which
|
||||
permit the dynamic creation of objects, entities, peers, etc. without
|
||||
the necessity of a reload.
|
||||
|
||||
Generally speaking, the columns in your tables should line up with the
|
||||
fields you would specify in the given entity declaration. If an entry
|
||||
would appear more than once, in the column it should be separated by a
|
||||
semicolon. For example, an entity that looks like:
|
||||
|
||||
[foo]
|
||||
host=dynamic
|
||||
secret=bar
|
||||
context=default
|
||||
context=local
|
||||
|
||||
could be stored in a table like this:
|
||||
|
||||
+------+--------+-------+--------------+----------+-----+-----------+
|
||||
| name | host | secret| context | ipaddr | port| regseconds|
|
||||
+------+--------+-------+--------------+----------+-----+-----------+
|
||||
| foo | dynamic| bar | default;local| 127.0.0.1| 4569| 1096954152|
|
||||
+------+--------+-------+--------------+----------+-----+-----------+
|
||||
|
||||
Note that for use with IAX or SIP, the table will also need the "name",
|
||||
"ipaddr", "port", "regseconds" columns. If you wanted to be able to
|
||||
configure the callerid, you could just add a callerid column to the
|
||||
table, for example.
|
||||
|
||||
A SIP table would look more like this:
|
||||
|
||||
+------+--------+-------+----------+-----+------------+----------+
|
||||
| name | host | secret| ipaddr | port| regseconds | username |
|
||||
+------+--------+-------+----------+-----+------------+----------+
|
||||
| foo | dynamic| bar | 127.0.0.1| 4569| 1096954152 | 1234 |
|
||||
+------+--------+-------+----------+-----+------------+----------+
|
||||
|
||||
in order to store appropriate parameters required for SIP.
|
||||
|
||||
In addition to this, if you add a field named "regserver" to the
|
||||
SIP peers table and have the system name set in asterisk.conf,
|
||||
Asterisk will store the system name that the user registered on in
|
||||
the database. This can be used to direct calls to go through the server
|
||||
that holds the registration (for NAT traversal purposes).
|
||||
|
||||
A Voicemail table would look more like this:
|
||||
|
||||
+----------+---------+----------+----------+-----------+---------------+
|
||||
| uniqueid | mailbox | context | password |email | fullname |
|
||||
+----------+---------+----------+----------+-----------+---------------+
|
||||
| 1 | 1234 | default | 4242 | a@b.com | Joe Schmoe |
|
||||
+----------+---------+----------+----------+-----------+---------------+
|
||||
|
||||
The uniqueid should be unique to each voicemail user and can be
|
||||
autoincrement. It need not have any relation to the mailbox or context.
|
||||
|
||||
An extension table would look more like this:
|
||||
|
||||
+----------+---------+----------+-------+-----------+
|
||||
| context | exten | priority | app | appdata |
|
||||
+----------+---------+----------+-------+-----------+
|
||||
| default | 1234 | 1 | Dial | Zap/1 |
|
||||
+----------+---------+----------+-------+-----------+
|
||||
|
||||
In the dialplan you just use the Realtime switch:
|
||||
|
||||
[foo]
|
||||
switch => Realtime
|
||||
|
||||
or:
|
||||
|
||||
[bar]
|
||||
switch => Realtime/bar@extensions
|
||||
|
@ -1,10 +1,12 @@
|
||||
The cdr\_tds module is NOT compatible with version 0.63 of FreeTDS.
|
||||
PLEASE NOTE
|
||||
|
||||
The cdr\_tds module is known to work with FreeTDS version 0.62.1;
|
||||
The cdr_tds module is NOT compatible with version 0.63 of FreeTDS.
|
||||
|
||||
The cdr_tds module is known to work with FreeTDS version 0.62.1;
|
||||
it should also work with 0.62.2, 0.62.3 and 0.62.4, which are bug
|
||||
fix releases.
|
||||
|
||||
The cdr\_tds module uses the raw "libtds" API of FreeTDS. It appears
|
||||
The cdr_tds module uses the raw "libtds" API of FreeTDS. It appears
|
||||
that from 0.63 onwards, this is not considered a published API
|
||||
of FreeTDS and is subject to change without notice.
|
||||
|
@ -0,0 +1,22 @@
|
||||
The Asterisk PBX supports H.323 via two totally separate
|
||||
channel drivers.
|
||||
|
||||
You can find more information Asterisk's native H.323
|
||||
support in /path/to/asterisk/channels/h323/README or
|
||||
you can download a third party driver at
|
||||
http://www.inaccessnetworks.com/projects/asterisk-oh323
|
||||
|
||||
Asterisk's native H.323 is supported and maintained by
|
||||
Jeremy McNamara (JerJer in irc). Support for the third
|
||||
party H.323 driver is supplied by inAccessNetworks.
|
||||
|
||||
If you have trouble with either driver you should direct
|
||||
your debug and comments to the appropriate party, making
|
||||
sure to be specific in exactly which H.323 driver you are
|
||||
running.
|
||||
|
||||
Please, read all supplied documentation before contacting
|
||||
either party for support. Many issues can be quickly
|
||||
resolved by simply following the instructions that are
|
||||
provided.
|
||||
|
@ -1,100 +0,0 @@
|
||||
\subsection{Introduction}
|
||||
|
||||
A PBX is only really useful if you can get calls into it. Of course, you
|
||||
can use Asterisk with VoIP calls (SIP, H.323, IAX), but you can also talk
|
||||
to the real PSTN through various cards.
|
||||
|
||||
Supported Hardware is divided into two general groups: Zaptel devices and
|
||||
non-zaptel devices. The Zaptel compatible hardware supports pseudo-TDM
|
||||
conferencing and all call features through chan\_zap, whereas non-zaptel
|
||||
compatible hardware may have different features.
|
||||
|
||||
\subsection{Zaptel compatible hardware}
|
||||
|
||||
\begin{itemize}
|
||||
\item Digium, Inc. (Primary Developer of Asterisk)
|
||||
http://www.digium.com
|
||||
\begin{itemize}
|
||||
\item Analog Interfaces
|
||||
\begin{itemize}
|
||||
\item TDM400P - The TDM400P is a half-length PCI 2.2-compliant card that supports FXS and FXO station interfaces for connecting analog telephones and analog POTS lines through a PC.
|
||||
\item TDM800P - The TDM800P is a half-length PCI 2.2-compliant, 8 port card using Digium's VoiceBus technology that supports FXS and FXO station interfaces for connecting analog telephones and analog POTS lines through a PC.
|
||||
\item TDM2400P - The TDM2400P is a full-length PCI 2.2-compliant card for connecting analog telephones and analog POTS lines through a PC. It supports a combination of up to 6 FXS and/or FXO modules for a total of 24 lines.
|
||||
\end{itemize}
|
||||
\item Digital Interfaces
|
||||
\begin{itemize}
|
||||
\item TE412P - The TE412P offers an on-board DSP-based echo cancellation module. It supports E1, T1, and J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE410P - The TE410P improves performance and scalability through bus mastering architecture. It supports E1, T1, and J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE407P - The TE407P offers an on-board DSP-based echo cancellation module. It supports E1, T1, and J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE405P - The TE405P improves performance and scalability through bus mastering architecture. It supports both E1, T1, J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE212P - The TE212P offers an on-board DSP-based echo cancellation module. It supports E1, T1, and J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE210P - The TE210P improves performance and scalability through bus mastering architecture. It supports E1, T1, and J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE207P - The TE207P offers an on-board DSP-based echo cancellation module. It supports E1, T1, and J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE205P - The TE205P improves performance and scalability through bus mastering architecture. It supports both E1 and T1/J1 environments and is selectable on a per-card or per-port basis.
|
||||
\item TE120P - The TE120P is a single span, selectable T1, E1, or J1 card and utilizes Digium's VoiceBus™ technology. It supports both voice and data modes.
|
||||
\item TE110P - The TE110P brings a high-performance, cost-effective, and flexible single span togglable T1, E1, J1 interface to the Digium line-up of telephony interface devices.
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Non-zaptel compatible hardware}
|
||||
|
||||
\begin{itemize}
|
||||
\item QuickNet, Inc.
|
||||
http://www.quicknet.net
|
||||
\begin{itemize}
|
||||
\item Internet PhoneJack - Single FXS interface. Supports Linux telephony
|
||||
interface. DSP compression built-in.
|
||||
|
||||
\item Internet LineJack - Single FXS or FXO interface. Supports Linux
|
||||
telephony interface.
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
\subsection{mISDN compatible hardware}
|
||||
|
||||
mISDN homepage: http://www.isdn4linux.de/mISDN/
|
||||
|
||||
Any adapter with an mISDN driver should be compatible with
|
||||
chan\_misdn. See the mISDN section for more information.
|
||||
|
||||
\begin{itemize}
|
||||
\item Digium, Inc. (Primary Developer of Asterisk)
|
||||
http://www.digium.com
|
||||
\begin{itemize}
|
||||
\item B410P - 4 Port BRI card (TE/NT)
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
\begin{itemize}
|
||||
\item beroNet
|
||||
http://www.beronet.com
|
||||
\begin{itemize}
|
||||
\item BN4S0 - 4 Port BRI card (TE/NT)
|
||||
|
||||
\item BN8S0 - 8 Port BRI card (TE/NT)
|
||||
|
||||
\item Billion Card - Single Port BRI card (TE (/NT with crossed cable) )
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Miscellaneous other interfaces}
|
||||
|
||||
\begin{itemize}
|
||||
\item Digium, Inc. (Primary Developer of Asterisk)
|
||||
\begin{itemize}
|
||||
\item TC400B - The TC400B is a half-length, low-profile PCI 2.2-compliant card for transforming complex VoIP codecs (G.729) into simple codecs.
|
||||
\end{itemize}
|
||||
|
||||
\item ALSA
|
||||
http://www.alsa-project.org
|
||||
\begin{itemize}
|
||||
\item Any ALSA compatible full-duplex sound card
|
||||
\end{itemize}
|
||||
|
||||
\item OSS
|
||||
http://www.opensound.com
|
||||
\begin{itemize}
|
||||
\item Any OSS compatible full-duplex sound card
|
||||
\end{itemize}
|
||||
\end{itemize}
|
@ -0,0 +1,74 @@
|
||||
A PBX is only really useful if you can get calls into it. Of course, you
|
||||
can use Asterisk with VoIP calls (SIP, H.323, IAX), but you can also talk
|
||||
to the real PSTN through various cards.
|
||||
|
||||
Supported Hardware is divided into two general groups: Zaptel devices and
|
||||
non-zaptel devices. The Zaptel compatible hardware supports pseudo-TDM
|
||||
conferencing and all call features through chan_zap, whereas non-zaptel
|
||||
compatible hardware may have different features.
|
||||
|
||||
Zaptel compatible hardware
|
||||
==========================
|
||||
|
||||
-- Digium (Primary author of Asterisk)
|
||||
http://www.digium.com, http://store.digium.com
|
||||
|
||||
* Wildcard T400P (obsolete) - Quad T1 interface connects to four T1/PRI
|
||||
interfaces. Supports RBS and PRI voice and PPP, FR, and HDLC data.
|
||||
|
||||
* Wildcard E400P (obsolete)- Quad E1 interface connects to four E1/PRI
|
||||
(or PRA) interfaces. Supports PRA/PRI, EuroISDN voice and data.
|
||||
|
||||
* Wildcard T100P - Single T1 interface connects to a single T1/PRI
|
||||
interface. Supports RBS and PRI voice and PPP, FR, and HDLC data.
|
||||
|
||||
* Wildcard E100P - Single E1 interface connects to a single E1/PRI (or PRA)
|
||||
interface. Supports PRA/PRI, EuroISDN voice and PPP, FR, HDLC data.
|
||||
|
||||
* Wildcard TDM400P - Quad Modular FXS interface connects to standard
|
||||
analog telephones.
|
||||
|
||||
* Wildcard TE410P - Quad T1/E1 switchable interface. Supports PRI and
|
||||
RBS signalling, as well as PPP, FR, and HDLC data modes.
|
||||
|
||||
Non-zaptel compatible hardware
|
||||
==============================
|
||||
|
||||
-- QuickNet, Inc.
|
||||
http://www.quicknet.net
|
||||
|
||||
* Internet PhoneJack - Single FXS interface. Supports Linux telephony
|
||||
interface. DSP compression built-in.
|
||||
|
||||
* Internet LineJack - Single FXS or FXO interface. Supports Linux
|
||||
telephony interface.
|
||||
|
||||
mISDN compatible hardware
|
||||
=========================
|
||||
mISDN homepage: http://www.isdn4linux.de/mISDN/
|
||||
|
||||
Any adapter with an mISDN driver should be compatible with
|
||||
chan_misdn. See misdn.txt for information.
|
||||
|
||||
-- beroNet
|
||||
http://www.beronet.com
|
||||
|
||||
* BN4S0 - 4 Port BRI card (TE/NT)
|
||||
|
||||
* BN8S0 - 8 Port BRI card (TE/NT)
|
||||
|
||||
* Billion Card - Single Port BRI card (TE (/NT with crossed cable) )
|
||||
|
||||
|
||||
Miscellaneous other interfaces
|
||||
==============================
|
||||
|
||||
-- ALSA
|
||||
http://www.alsa-project.org
|
||||
|
||||
* Any ALSA compatible full-duplex sound card
|
||||
|
||||
-- OSS
|
||||
http://www.opensound.com
|
||||
|
||||
* Any OSS compatible full-duplex sound card
|
@ -0,0 +1,67 @@
|
||||
Inter-Asterisk eXchange Protocol
|
||||
================================
|
||||
|
||||
Usage:
|
||||
======
|
||||
The format for the dialing string on Asterisk is:
|
||||
IAX/[user@]peer[:exten[@context]]
|
||||
|
||||
(Note, []'s denote optional fields). The peer is either an IP address
|
||||
or a peer as specified in the /etc/asterisk/iax.conf file. Exten is
|
||||
an optional requested extension (otherwise "s" will be used), and
|
||||
"context" is an optional context to request. The user is an optional
|
||||
username specified in the peer's iax.conf. If the user is not specified,
|
||||
the peer will select one.
|
||||
|
||||
The peer uses a score to determine the best user entry to match against if
|
||||
one is not specified:
|
||||
|
||||
1. User entry last specified in iax.conf (this is the baseline).
|
||||
2. User entry with secret specified and ACL specified.
|
||||
3. User entry with no secret specified and no ACL specified.
|
||||
4. User entry with no secret specified and ACL specified.
|
||||
5. User entry matched via username.
|
||||
|
||||
The higher the score the better it is with 5 being an exact match and the maximum
|
||||
score possible.
|
||||
|
||||
Protocol and rationale:
|
||||
=======================
|
||||
IAX is a simple, low overhead and low bandwidth VoIP protocol designed to
|
||||
allow multiple Asterisk PBX's to communicate with one another without
|
||||
the overhead of more complex protocols like H.323. Payload is sent with
|
||||
a header overhead of only 4 octets. Control functions (and one payload packet
|
||||
per minute or so) is sent with a more complex header of 12 octets.
|
||||
|
||||
IAX is slightly stateful.
|
||||
|
||||
IAX contains two kinds of packets: The full header packet type, which
|
||||
contains much information about the frame, in addition to its contents,
|
||||
and the mini header type, which is used only for non-reliable voice
|
||||
packet delivery.
|
||||
|
||||
All packets are immediately transmitted. Packets are received, but not
|
||||
delivered to the actual channels until a given time quantum has passed, in
|
||||
order to try to eliminate jitter.
|
||||
|
||||
All full header packets must be ackd (except, obviously for the ACK packets
|
||||
themselves and not so obviously for hangup packets). The "timestamp" field of
|
||||
ack packets is not the normal offset, but rather a quote of the timestamp as
|
||||
included with the original packet that you're acking, and likewise the
|
||||
seqno field is the seqno of the packet you're acking, not your own seqno,
|
||||
and you do not increment your own sequence number. ACKing is based on the
|
||||
sequence number.
|
||||
|
||||
See iax.h for a description of the frame formats.
|
||||
|
||||
IAX internal frames use the AST_FRAME_IAX type. The subclass of these
|
||||
frames is the IAX control number, as seen in iax.h. The first frame sent
|
||||
must be an AST_FRAME_IAX with the control AST_IAX_CONTROL_NEW.
|
||||
|
||||
The AST_IAX_CONTROL_NEW establishes a new connection.
|
||||
|
||||
The first frame sent MUST be an AST_CONTROL_NEW to start a connection.
|
||||
|
||||
IAX connnections may require authentication using either simple plaintext
|
||||
passwords or an md5 challenge/response pair.
|
||||
|
@ -1,7 +1,12 @@
|
||||
Icecast + Asterisk
|
||||
==================
|
||||
The advent of icecast into Asterisk allows you to do neat things like have
|
||||
a caller stream right into an ice-cast stream as well as using chan\_local
|
||||
a caller stream right into an ice-cast stream as well as using chan_local
|
||||
to place things like conferences, music on hold, etc. into the stream.
|
||||
|
||||
You'll need to specify a config file for the ices encoder. An example is
|
||||
included in contrib/asterisk-ices.xml.
|
||||
included in contrib/asterisk-ices.xml
|
||||
|
||||
Anyway hope you like it.
|
||||
|
||||
Mark
|
@ -0,0 +1,98 @@
|
||||
As of 2004-12-23, this documentation is no longer maintained. The doxygen documentation
|
||||
generated from linkedlists.h should be referred to in its place, as it is more complete
|
||||
and better maintained.
|
||||
|
||||
2nd version, implemented as macros.
|
||||
|
||||
include <asterisk/linkedlists.h>
|
||||
|
||||
AST_LIST_ENTRY declares pointers inside the object structure :
|
||||
|
||||
struct ast_var_t {
|
||||
char *name;
|
||||
char *value;
|
||||
AST_LIST_ENTRY(ast_var_t) listpointers;
|
||||
};
|
||||
|
||||
AST_LIST_HEAD declares a head structure, which is initialized
|
||||
to AST_LIST_HEAD_NULL :
|
||||
|
||||
AST_LIST_HEAD(head, ast_var_t) head
|
||||
|
||||
Next, we declare a pointer to this structure :
|
||||
|
||||
struct headtype *headp = head;
|
||||
|
||||
AST_LIST_INIT initializes the head pointer to a null value
|
||||
|
||||
AST_LIST_INIT(headp);
|
||||
|
||||
AST_LIST_INSERT_HEAD inserts an element to the head of the list :
|
||||
|
||||
struct ast_var_t *node;
|
||||
|
||||
node=malloc(sizeof(struct ast_var_t));
|
||||
(...we fill data in struct....)
|
||||
data->name=malloc(100);
|
||||
strcpy(data->name,"lalalalaa");
|
||||
etc etc
|
||||
|
||||
(then we insert the node in the head of the list :)
|
||||
|
||||
AST_LIST_INSERT_HEAD(headp,node,listpointers);
|
||||
|
||||
AST_LIST_INSERT_HEAD_AFTER inserts an element after another :
|
||||
|
||||
struct ast_var_t *node1;
|
||||
...
|
||||
AST_LIST_INSERT_AFTER(node,node1,listpointers);
|
||||
|
||||
AST_LIST_REMOVE removes an arbitrary element from the head:
|
||||
|
||||
AST_LIST_REMOVE(headp,node1,ast_var_t,listpointers);
|
||||
|
||||
AST_LIST_REMOVE_HEAD removes the entry at the head of the list and
|
||||
returns a pointer to the removed entry:
|
||||
|
||||
AST_LIST_REMOVE_HEAD(headp,node,listpointers);
|
||||
|
||||
AST_LIST_FIRST returns a pointer to the first element of the list;
|
||||
|
||||
struct ast_var_t *firstnode;
|
||||
firstnode=AST_LIST_FIRST(headp);
|
||||
|
||||
AST_LIST_NEXT returns a pointer to the next element :
|
||||
|
||||
struct ast_var_t *nextnode;
|
||||
nextnode=AST_LIST_NEXT(firstnode,listpointers);
|
||||
|
||||
AST_LIST_TRAVERSE traverses all elements of the list :
|
||||
|
||||
struct ast_var_t *node;
|
||||
|
||||
AST_LIST_TRAVERSE(headp,node,listpointers) {
|
||||
printf("%s\n",node->name);
|
||||
}
|
||||
|
||||
AST_LIST_EMPTY evaluates to a true condition if there are no elements on
|
||||
the list.
|
||||
|
||||
To completely delete a list :
|
||||
|
||||
struct ast_var_t *vardata;
|
||||
|
||||
while (!AST_LIST_EMPTY(headp)) { /* List Deletion. */
|
||||
vardata = AST_LIST_REMOVE_HEAD(head, ast_var_t, listpointers);
|
||||
free(vardata->name);
|
||||
free(vardata->value);
|
||||
}
|
||||
|
||||
AST_LIST_LOCK returns true if it can lock the list, AST_LIST_UNLOCK unlocks
|
||||
the list :
|
||||
|
||||
if (AST_LIST_LOCK(headp)) {
|
||||
...do all list operations here...
|
||||
AST_LIST_UNLOCK(headp);
|
||||
} else {
|
||||
ast_log(LOG_WARNING,"List locked bla bla bla\n");
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
|
||||
Mathematical dialplan function
|
||||
|
||||
Yeah, I thought it was a little insane too..
|
||||
|
||||
adds:
|
||||
|
||||
Sum, Multiply, Divide, Subtract, Modulus, GT, LT, GTE, LTE, EQ functions to Asterisk
|
||||
|
||||
All functions follow the same basic pattern for parameters:
|
||||
|
||||
parameter 1 = the math expression
|
||||
parameter 2 = the type of result
|
||||
|
||||
Perform calculation on number 1 to number 2. Valid ops are:
|
||||
+,-,/,*,%,<,>,>=,<=,==
|
||||
and behave as their C equivalents.
|
||||
|
||||
<type_of_result> - wanted type of result:
|
||||
f, float - float(default)
|
||||
i, int - integer,
|
||||
h, hex - hex,
|
||||
c, char - char
|
||||
|
||||
Each math expression is performed as
|
||||
|
||||
Action param1 on param2
|
||||
|
||||
eg:
|
||||
|
||||
Action = Divide
|
||||
Param1 = 10
|
||||
Param2 = 2
|
||||
|
||||
Results in
|
||||
|
||||
Divide 10 by 2
|
||||
|
||||
|
||||
Example dialplan:
|
||||
|
||||
exten => 11099,1,Set(RV=${MATH(1+20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(10*2)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(10*2)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(10-2)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(2%10)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(10/0)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(10-200)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(1-20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(1<20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(1>=20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(101>20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(1==20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(20<=20)})
|
||||
exten => 11099,n,NOOP(${RV})
|
||||
exten => 11099,n,Set(RV=${MATH(123%16,int)})
|
||||
exten => 11099,n,NOOP(${RV})
|
@ -0,0 +1,15 @@
|
||||
Description of call model:
|
||||
|
||||
Incoming Call:
|
||||
|
||||
Channel backend waits for a RING or equivalent on some sort of
|
||||
interface. Typically this is done in its own thread. When a RING is
|
||||
detected, the backend should create a channel structure and then call
|
||||
ast_pbx_start() on that channel, which will create a thread to monitor
|
||||
that interface. At this point, the PBX and/or applications it launches
|
||||
will manage the interface, and it need not be monitored by the
|
||||
aforementioned thread. When the applications are finished, the requisite
|
||||
hangup function will be called, at which the channel can be considered to
|
||||
be no longer valid, and the thread that controls it will imminently be
|
||||
terminated.
|
||||
|
@ -1,5 +1,7 @@
|
||||
\subsubsection{MP3 Music On Hold}
|
||||
* Asterisk MP3 Support
|
||||
======================
|
||||
|
||||
* MP3 Music On Hold
|
||||
Use of the mpg123 for your music on hold is no longer recommended and is now
|
||||
officially deprecated. You should now use one of the native formats for your
|
||||
music on hold selections.
|
@ -0,0 +1,8 @@
|
||||
About Hold Music
|
||||
================
|
||||
Digium has licensed the music included with
|
||||
the Asterisk distribution From FreePlayMusic
|
||||
for use and distribution with Asterisk. It
|
||||
is licensed ONLY for use as hold music within
|
||||
an Asterisk based PBX.
|
||||
|
@ -0,0 +1,15 @@
|
||||
MYSQL LICENSING UPDATE
|
||||
======================
|
||||
We were recently contacted by MySQL and informed that the MySQL client
|
||||
libraries are now under GPL license and not LGPL license as before.
|
||||
|
||||
Since Asterisk does allow exceptions to GPL, we are removing MySQL support
|
||||
from standard Asterisk. We will, where appropriate, make it available via
|
||||
a separate package which will only be usable when Asterisk is used completely
|
||||
within GPL (i.e. not in conjunction with G.729, OpenH.323, etc). We
|
||||
apologize for the confusion.
|
||||
|
||||
You may find this in the new "asterisk-addons" package.
|
||||
|
||||
Mark Spencer
|
||||
Digium
|
@ -0,0 +1,203 @@
|
||||
Call Detail Recording to RADIUS Server
|
||||
======================================
|
||||
|
||||
|
||||
Configuration of Asterisk to send CDRs to (Free)RADIUS servers.
|
||||
|
||||
|
||||
A. What is needed :
|
||||
* FreeRADIUS server
|
||||
* Radiusclient-ng library
|
||||
* Asterisk PBX
|
||||
|
||||
|
||||
+--------------------+
|
||||
| Asterisk PBX |
|
||||
| |
|
||||
|********************|
|
||||
| | +---------------+
|
||||
| RADIUS client |------->| RADIUS server |
|
||||
| |<-------| (FreeRADIUS) |
|
||||
+--------------------+ +---------------+
|
||||
|
||||
|
||||
|
||||
|
||||
B. Steps to follow in order to have RADIUS support:
|
||||
|
||||
1.Radiusclient library
|
||||
1.a Installation
|
||||
|
||||
Download the sources from:
|
||||
|
||||
http://developer.berlios.de/projects/radiusclient-ng/
|
||||
|
||||
Untar the source tarball.
|
||||
root@localhost:/usr/local/src# tar xvfz radiusclient-ng-0.5.2.tar.gz
|
||||
|
||||
Compile and install the library.
|
||||
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
|
||||
|
||||
1.b Configuration
|
||||
|
||||
By default all the configuration files of the radiusclient library will
|
||||
be in /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.
|
||||
|
||||
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 /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.
|
||||
|
||||
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
|
||||
/usr/local/etc/radiusclient-ng/dictionary
|
||||
the line:
|
||||
|
||||
$INCLUDE /path/to/dictionary.digium
|
||||
|
||||
2.FreeRADIUS Server (Version 1.1.1)
|
||||
2.a Installation
|
||||
|
||||
Download sources tarball from:
|
||||
|
||||
http://freeradius.org/
|
||||
|
||||
Untar, configure, build, and install the server:
|
||||
|
||||
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
|
||||
|
||||
All the configuration files of FreeRADIUS server will be in
|
||||
/usr/local/etc/raddb directory.
|
||||
|
||||
|
||||
2.b Configuration
|
||||
|
||||
There are several file that have to be modified to configure the
|
||||
RADIUS server. These are presented next.
|
||||
|
||||
File "clients.conf"
|
||||
|
||||
File /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:
|
||||
client myhost {
|
||||
secret = mysecret
|
||||
shortname = foo
|
||||
}
|
||||
|
||||
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 /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 '/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.
|
||||
|
||||
|
||||
3. 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
|
||||
/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 /include/asterisk/cdr.h
|
||||
for all the fields which are recorded. By default, records in comma
|
||||
separated values will be created in /var/log/asterisk/cdr-csv.
|
||||
|
||||
The configuration file for cdr_radius.so module is :
|
||||
|
||||
/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.
|
||||
|
||||
|
||||
4. Logged Values
|
||||
|
||||
"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
|
||||
|
Binary file not shown.
Loading…
Reference in new issue