Skip to content
Snippets Groups Projects
Commit f7dc3692 authored by Russell Bryant's avatar Russell Bryant
Browse files

Merged revisions 58638 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58638 | russell | 2007-03-09 17:59:10 -0600 (Fri, 09 Mar 2007) | 8 lines

Merge some updates to the SLA documentation.  I plan to keep working on this
to explain all of the expected behavior with call handling, configuration
details for specific phones, and other things.  However, I got tired of doing
it in plain text, so I switched to using LaTeX.  I have included the PDF version.
I haven't been able to get a nice looking plain text version out of it yet, but
I'm not terribly concerned since this is supposed to be more of the manual,
while the plain text sample configuration file is the reference.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 96f7036c
No related branches found
No related tags found
No related merge requests found
File added
------------------------------------------------------------------------------- \documentclass[12pt,a4]{article}
--- Shared Line Appearances --------------------------------------------------- \usepackage{hyperref}
-------------------------------------------------------------------------------
------------------------------------------------------------------------------- \author{Russell Bryant \\ Software Engineer \\ Digium, Inc.}
INTRODUCTION \title{Shared Line Appearances}
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}
The "SLA" functionality in Asterisk is intended to allow a setup that emulates The "SLA" functionality in Asterisk is intended to allow a setup that emulates
a simple key system. It uses the various abstraction layers already built into a simple key system. It uses the various abstraction layers already built into
Asterisk to emulate key system functionality across various devices, including Asterisk to emulate key system functionality across various devices, including
IP channels. IP channels.
-------------------------------------------------------------------------------
------------------------------------------------------------------------------- \section{Configuration}
DIALPLAN CONFIGURATION
\subsection{Summary}
An SLA system is built up of virtual trunks and stations mapped to real
Asterisk devices. The configuration for all of this is done in three
different files: extensions.conf, sla.conf, and the channel specific
configuration file such as sip.conf or zapata.conf.
\subsection{Dialplan}
The SLA implementation can automatically generate the dialplan necessary for The SLA implementation can automatically generate the dialplan necessary for
basic operation if the "autocontext" option is set for trunks and stations in basic operation if the "autocontext" option is set for trunks and stations in
sla.conf. However, for reference, here is an automatically generated dialplan sla.conf. However, for reference, here is an automatically generated dialplan
to help with custom building of the dialplan to include other features, such as to help with custom building of the dialplan to include other features, such as
voicemail. voicemail (\ref{voicemail}).
However, note that there is a little bit of additional configuration needed if However, note that there is a little bit of additional configuration needed if
the trunk is an IP channel. This is discussed in the TRUNKS section. the trunk is an IP channel. This is discussed in the section on trunks (\ref{trunks}).
There are extensions for incoming calls on a specific trunk, which execute the SLATrunk
application, as well as incoming calls from a station, which execute SLAStation.
Note that there are multiple extensions for incoming calls from a station. This is
because the SLA system has to know whether the phone just went off hook, or if the
user pressed a specific line button.
Also note that there is a hint for every line on every station. This lets the SLA
system control each individual light on every phone to ensure that it shows the
correct state of the line. The phones must subscribe to the state of each of their
line appearances.
\begin{verbatim}
[line1] [line1]
exten => s,1,SLATrunk(line1) exten => s,1,SLATrunk(line1)
...@@ -47,10 +73,23 @@ exten => station3_line1,hint,SLA:station3_line1 ...@@ -47,10 +73,23 @@ exten => station3_line1,hint,SLA:station3_line1
exten => station3_line1,1,SLAStation(station3_line1) exten => station3_line1,1,SLAStation(station3_line1)
exten => station3_line2,hint,SLA:station3_line2 exten => station3_line2,hint,SLA:station3_line2
exten => station3_line2,1,SLAStation(station3_line2) exten => station3_line2,1,SLAStation(station3_line2)
-------------------------------------------------------------------------------
------------------------------------------------------------------------------- \end{verbatim}
TRUNKS
\subsection{Trunks}
\label{trunks}
An SLA trunk is a mapping between a virtual trunk and a real Asterisk device.
This device may be an analog FXO line, or something like a SIP trunk. A trunk
must be configured in two places. First, configure the device itself in the
channel specific configuration file such as zapata.conf or sip.conf. Once the
trunk is configured, then map it to an SLA trunk in sla.conf.
\begin{verbatim}
[line1]
type=trunk
device=Zap/1
\end{verbatim}
Be sure to configure the trunk's context to be the same one that is set for the Be sure to configure the trunk's context to be the same one that is set for the
"autocontext" option in sla.conf if automatic dialplan configuration is used. "autocontext" option in sla.conf if automatic dialplan configuration is used.
...@@ -70,27 +109,27 @@ For this example, let's say we have a SIP trunk called "mytrunk" that is going ...@@ -70,27 +109,27 @@ For this example, let's say we have a SIP trunk called "mytrunk" that is going
to be used as line4. Furthermore, when calls come in on this trunk, they are to be used as line4. Furthermore, when calls come in on this trunk, they are
going to say that they are calling the number "12564286000". Also, let's say going to say that they are calling the number "12564286000". Also, let's say
that the numbers that are valid for calling out this trunk are NANP numbers, that the numbers that are valid for calling out this trunk are NANP numbers,
of the form _1NXXNXXXXXX. of the form \_1NXXNXXXXXX.
In sip.conf, there would be an entry for [mytrunk]. For [mytrunk], In sip.conf, there would be an entry for [mytrunk]. For [mytrunk],
set context=line4. set context=line4.
sla.conf: \begin{verbatim}
[line4] [line4]
type=trunk type=trunk
device=Local/disa@line4_outbound device=Local/disa@line4_outbound
\end{verbatim}
extensions.conf: \begin{verbatim}
[line4] [line4]
exten => 12564286000,1,SLATrunk(line4) exten => 12564286000,1,SLATrunk(line4)
[line4_outbound] [line4_outbound]
exten => disa,1,Disa(no-password|line4_outbound) exten => disa,1,Disa(no-password|line4_outbound)
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@mytrunk) exten => _1NXXNXXXXXX,1,Dial(SIP/\${EXTEN}@mytrunk)
\end{verbatim}
So, when a station picks up their phone and connects to line 4, they are So, when a station picks up their phone and connects to line 4, they are
...@@ -98,44 +137,57 @@ connected to the local dialplan. The Disa application plays dialtone to the ...@@ -98,44 +137,57 @@ connected to the local dialplan. The Disa application plays dialtone to the
phone and collects digits until it matches an extension. In this case, once phone and collects digits until it matches an extension. In this case, once
the phone dials a number like 12565551212, the call will proceed out the the phone dials a number like 12565551212, the call will proceed out the
SIP trunk. SIP trunk.
-------------------------------------------------------------------------------
------------------------------------------------------------------------------- \subsection{Stations}
STATIONS
An SLA station is a mapping between a virtual station and a real Asterisk device.
Currently, the only channel driver that has all of the features necessary to Currently, the only channel driver that has all of the features necessary to
support an SLA environment is chan_sip. Here are some hints on configuring support an SLA environment is chan\_sip. So, to configure a SIP phone to use
a SIP phone for use with SLA: as a station, you must configure sla.conf and sip.conf.
1) Add the SIP channel as a [station] in sla.conf. \begin{verbatim}
[station1]
type=station
device=SIP/station1
trunk=line1
trunk=line2
\end{verbatim}
Here are some hints on configuring a SIP phone for use with SLA:
\begin{enumerate}
\item Add the SIP channel as a [station] in sla.conf.
2) Configure the phone in sip.conf. If automatic dialplan configuration was \item Configure the phone in sip.conf. If automatic dialplan configuration was
used by enabling the "autocontext" option in sla.conf, then this entry in used by enabling the "autocontext" option in sla.conf, then this entry in
sip.conf should have the same context setting. sip.conf should have the same context setting.
3) On the phone itself, there are various things that must be configured to \item On the phone itself, there are various things that must be configured to
make everything work correctly: make everything work correctly:
Let's say this phone is called "station1" in sla.conf, and it uses trunks Let's say this phone is called "station1" in sla.conf, and it uses trunks
named "line1" and line2". named "line1" and line2".
\begin{enumerate}
a) Two line buttons must be configured to subscribe to the state of the
\item Two line buttons must be configured to subscribe to the state of the
following extensions: following extensions:
- station1_line1 - station1\_line1
- station1_line2 - station1\_line2
b) The line appearance buttons should be configured to dial the extensions \item The line appearance buttons should be configured to dial the extensions
that they are subscribed to when they are pressed. that they are subscribed to when they are pressed.
c) If you would like the phone to automatically connect to a trunk when it \item If you would like the phone to automatically connect to a trunk when it
is taken off hook, then the phone should be automatically configured to is taken off hook, then the phone should be automatically configured to
dial "station1" when it is taken off hook. dial "station1" when it is taken off hook.
-------------------------------------------------------------------------------
\end{enumerate}
\end{enumerate}
------------------------------------------------------------------------------- \section{Configuration Examples}
VOICEMAIL \subsection{SLA and Voicemail}
\label{voicemail}
This is an example of how you could set up a single voicemail box for the This is an example of how you could set up a single voicemail box for the
phone system. The voicemail box number used in this example is 1234, which phone system. The voicemail box number used in this example is 1234, which
...@@ -147,14 +199,14 @@ SIP/station3. ...@@ -147,14 +199,14 @@ SIP/station3.
In zapata.conf, channel 1 has context=line1 and channel 2 has context=line2. In zapata.conf, channel 1 has context=line1 and channel 2 has context=line2.
In sip.conf, all three stations are configured with context=sla_stations. In sip.conf, all three stations are configured with context=sla\_stations.
When the stations pick up their phones to dial, they are allowed to dial When the stations pick up their phones to dial, they are allowed to dial
NANP numbers for outbound calls, or 8500 for checking voicemail. NANP numbers for outbound calls, or 8500 for checking voicemail.
sla.conf: sla.conf:
\begin{verbatim}
[line1] [line1]
type=trunk type=trunk
device=Local/disa@line1_outbound device=Local/disa@line1_outbound
...@@ -176,10 +228,12 @@ device=SIP/station2 ...@@ -176,10 +228,12 @@ device=SIP/station2
[station3](station) [station3](station)
device=SIP/station3 device=SIP/station3
\end{verbatim}
extensions.conf: extensions.conf:
\begin{verbatim}
[macro-slaline] [macro-slaline]
exten => s,1,SLATrunk(${ARG1}) exten => s,1,SLATrunk(${ARG1})
exten => s,n,Goto(s-${SLATRUNK_STATUS}|1) exten => s,n,Goto(s-${SLATRUNK_STATUS}|1)
...@@ -221,5 +275,65 @@ exten => station3_line1,hint,SLA:station3_line1 ...@@ -221,5 +275,65 @@ exten => station3_line1,hint,SLA:station3_line1
exten => station3_line1,1,SLAStation(station3_line1) exten => station3_line1,1,SLAStation(station3_line1)
exten => station3_line2,hint,SLA:station3_line2 exten => station3_line2,hint,SLA:station3_line2
exten => station3_line2,1,SLAStation(station3_line2) exten => station3_line2,1,SLAStation(station3_line2)
\end{verbatim}
\section{Call Handling}
\subsection{Summary}
This section is intended to describe how Asterisk handles calls inside of the
SLA system so that it is clear what behavior is expected.
Note that this section is not yet complete.
\subsection{Station goes off hook (not ringing)}
When a station goes off hook, it should initiate a call to Asterisk with the
extension that indicates that the phone went off hook without specifying a
specific line. In the examples in this document, for the station named
"station1", this extension is simply named, "station1".
Asterisk will attempt to connect this station to the first available trunk
that is not in use. Asterisk will check the trunks in the order that they
were specified in the station entry in sla.conf. If all trunks are in use,
the call will be denied.
If Asterisk is able to acquire an idle trunk for this station, then trunk
is connected to the station and the station will hear dialtone. The station
can then proceed to dial a number to call. As soon as a trunk is acquired,
all appearances of this line on stations will show that the line is in use.
\subsection{Station goes off hook (ringing)}
When a station goes off hook while it is ringing, it should simply answer
the call that had been initiated to it to make it ring. Once the station
has answered, Asterisk will figure out which trunk to connect it to. It
will connect it to the highest priority trunk that is currently ringing.
Trunk priority is determined by the order that the trunks are listed in
the station entry in sla.conf.
\subsection{Line button on a station is pressed}
When a line button is pressed on a station, the station should initiate a
call to Asterisk with the extension that indicates which line button was
pressed. In the examples given in this document, for a station named
"station1" and a trunk named "line1", the extension would be "station1\_line1".
If the specified trunk is not in use, then the station will be connected to it and
will hear dialtone. All appearances of this trunk will then show that it
is now in use.
If the specified trunk is on hold by this station, then this station will be
reconnected to the trunk. The line appearance for this trunk on this station
will now show in use. If this was the only station that had the call on hold,
then all appearances of this trunk will now show that it is in use. Otherwise,
all stations that are not currently connected to this trunk will show it
on hold.
If the specified trunk is on hold by a different station, then this station
will be connected to the trunk only if the trunk itself and the station(s) that
have it on hold do not have private hold enabled. If connected, the appeareance
of this trunk on this station will then show in use. All stations that are not
currently connected to this trunk will show it on hold.
------------------------------------------------------------------------------- \end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment