Merge changes from team/russell/sla_updates.

This batch of changes to the SLA code does a few different things.

* I made the SLA code event driven instead of having to act in a lot of busy
  loops while dialing things to wait for state changes.  This makes the code
  more efficient and readable at the same time.

* I have implemented a couple of new features.  The first is inbound trunk
  ringing timeouts.  This is an option that defines how long to let an incoming
  call on a trunk to ring.

* I have also implemented ring timeouts for stations.  They may be specified
  for the entire station, meaning it is how long to let the station ring before
  giving up.  You can also specify a ring timeout for a specific trunk on a
  station.  So, you can say that you only want a specific station to ring 5
  seconds if it is line1 ringing, but otherwise, there is no timeout.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Russell Bryant 19 years ago
parent 4565c1483c
commit f314685447

File diff suppressed because it is too large Load Diff

@ -22,6 +22,9 @@
; a unique context name. Then, in zapata.conf, this device
; should be configured to have incoming calls go to this context.
;ringtimeout=30 ; Set how long to allow this trunk to ring on an inbound call before hanging
; it up as an unanswered call. The value is in seconds.
;[line2]
;type=trunk
;device=Zap/4
@ -41,10 +44,6 @@
; ---- Station Declarations ------------
;[station](!) ; In this example, all stations have the same trunks, so this
; configuration template is used to simplify the declaration
; of each station.
;type=station ; This line indicates that this entry is a station.
;autocontext=sla_stations ; This supports automatic generation of the dialplan entries if
@ -52,13 +51,21 @@
; context without conflict. The device for this station should
; have its context configured to the same one listed here.
;ringtimeout=10 ; Set a timeout for how long to allow the station to ring for an
; ; incoming call, in seconds.
;trunk=line1 ; Individually list all of the trunks that will appear on this station. This
; order is significant. It should be the same order as they appear on the
; phone. The order here defines the order of preference that the trunks will
; be used.
;trunk=line2
;trunk=line3
;trunk=line4
;trunk=line4,ringtimeout=5 ; A ring timeout for the station can also be specified for a specific trunk.
; If a ring timeout is specified both for the whole station and for a specific
; trunk on a station, the setting for the specific trunk will take priority.
; This value is in seconds.
;[station1](station) ; Define a station that uses the configuration from the template "station".
;device=SIP/station1 ; Each station must be mapped to a device.

@ -1,17 +1,17 @@
-------------------------------------------------------------
--- Shared Line Appearances ---------------------------------
-------------------------------------------------------------
-------------------------------------------------------------------------------
--- Shared Line Appearances ---------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------
-------------------------------------------------------------------------------
INTRODUCTION
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
Asterisk to emulate key system functionality across various devices, including
IP channels.
-------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------
-------------------------------------------------------------------------------
DIALPLAN CONFIGURATION
The SLA implementation can automatically generate the dialplan necessary for
@ -44,9 +44,9 @@ exten => station3_line1,hint,SLA:station3_line1
exten => station3_line1,1,SLAStation(station3_line1)
exten => station3_line2,hint,SLA:station3_line2
exten => station3_line2,1,SLAStation(station3_line2)
-------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------
-------------------------------------------------------------------------------
TRUNKS
For the trunk side of SLA, the only channels that are currently supported are
@ -57,10 +57,10 @@ Be sure to configure the trunk's context to be the same one that is set for the
If the dialplan is being built manually, ensure that calls coming in on a trunk
execute the SLATrunk() application with an argument of the trunk name.
-------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------
-------------------------------------------------------------------------------
STATIONS
Currently, the only channel driver that has all of the features necessary to
@ -90,4 +90,4 @@ a SIP phone for use with SLA:
c) 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
dial "station1" when it is taken off hook.
-------------------------------------------------------------
-------------------------------------------------------------------------------

@ -559,7 +559,7 @@ enum ast_dial_result ast_dial_run(struct ast_dial *dial, struct ast_channel *cha
/* If we are running async spawn a thread and send it away... otherwise block here */
if (async) {
set_state(dial, AST_DIAL_RESULT_TRYING);
dial->state = AST_DIAL_RESULT_TRYING;
/* Try to create a thread */
if (ast_pthread_create(&dial->thread, NULL, async_dial, dial)) {
/* Failed to create the thread - hangup all dialed channels and return failed */

Loading…
Cancel
Save