All pastes #2541 Raw Edit

Revised diaplan for slak2

public text v1 · immutable
#2541 ·published 2004-12-01 18:20 UTC
rendered paste body
;
; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your
; inbound and outbound calls in Asterisk.
;

;
; The "General" category is for certain variables.
;
[general]
;
; If static is set to no, or omitted, then the pbx_config will rewrite
; this file when extensions are modified.  Remember that all comments
; made in the file will be lost when that happens.
;
; XXX Not yet implemented XXX
;
static=yes
;
; if static=yes and writeprotect=no, you can save dialplan by
; CLI command 'save dialplan' too
;
writeprotect=no

; You can include other config files, use the #include command (without the ';')
; Note that this is different from the "include" command that includes contexts within
; other contexts. The #include command works in all asterisk configuration files.
;#include "filename.conf"

; The "Globals" category contains global variables that can be referenced
; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental variable
; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
;
[globals]
CONSOLE=Console/dsp                             ; Console interface for demo
;CONSOLE=Zap/1

[extensions]

; steve
exten => 001,1,Dial(SIP/001,20)          ; Ring for 20 seconds
exten => 001,2,Voicemail(u${EXTEN})      ; Unavail voicemail if extension doesn't answer
exten => 001,3,Hangup
exten => 001,102,Voicemail(b${EXTEN})    ; Busy Voicemail if extension is busy
exten => 001,103,Hangup

;matt
exten => 002,1,Dial(SIP/002,20)
exten => 002,2,Voicemail(u${EXTEN})
exten => 002,3,Hangup
exten => 002,102,Voicemail(b${EXTEN})
exten => 002,103,Hangup

;june
exten => 003,1,Dial(SIP/003,20)
exten => 003,2,Voicemail(u${EXTEN})
exten => 003,3,Hangup
exten => 003,102,Voicemail(b${EXTEN})
exten => 003,103,Hangup

;vladimir
exten => 111,1,Dial(SIP/111,20)
exten => 111,2,Voicemail(u${EXTEN})
exten => 111,3,Hangup
exten => 111,102,Voicemail(b${EXTEN})
exten => 111,103,Hangup

;hongping
exten => 112,1,Dial(SIP/112,20)
exten => 112,2,Voicemail(u${EXTEN})
exten => 112,3,Hangup
exten => 112,102,Voicemail(b${EXTEN})
exten => 112,103,Hangup

;david
exten => 113,1,Dial(SIP/113,20)
exten => 113,2,Voicemail(u${EXTEN})
exten => 113,3,Hangup
exten => 113,102,Voicemail(b${EXTEN})
exten => 113,103,Hangup

;alex
exten => 114,1,Dial(SIP/114,20)
exten => 114,2,Voicemail(u${EXTEN})
exten => 114,3,Hangup
exten => 114,102,Voicemail(b${EXTEN})
exten => 114,103,Hangup

;
; Access VoiceMail
;
exten => 500,1,VoicemailMain(s${CALLERIDNUM})
exten => 500,2,Hangup
;
; Create an extension, 501, for evaulating echo latency.
;
exten => 501,1,Playback(demo-echotest) ; Let them know what's going on
exten => 501,2,Echo                    ; Do the echo test
exten => 501,3,Playback(demo-echodone) ; Let them know it's over
exten => 501,4,Goto(s,4)               ; Start over
;
; Record a temporary GSM file
;
exten => 502,1,Wait(2)
exten => 502,2,Record(/tmp/asterisk-recording:gsm)
exten => 502,3,Wait(2)
exten => 502,4,Playback(/tmp/asterisk-recording)
exten => 502,5,Wait(2)
exten => 502,6,Hangup
;
; Say Current Date and Time
;
exten => 503,1,DateTime()
exten => 503,2,Wait(1)
exten => 503,3,DateTime()
exten => 503,4,Hangup
;
; Read back caller's number
;
exten => 504,1,Wait(1)
exten => 504,2,SayDigits(${CALLERIDNUM})
exten => 504,3,Wait(1)
exten => 504,4,SayDigits(${CALLERIDNUM})
exten => 504,5,Hangup
;
; Emergency calls
;
exten => 911,1,Dial(ZAP/g1/911)
;
;
; Information calls
exten => 411,1,Dial(ZAP/g1/411)
;
;
; Telco calls
exten => 611,1,Dial(ZAP/g1/611)
;


[incoming]

exten => s,1,Answer
exten => s,2,Wait,1
exten => s,3,DigitTimeout(10)           ; Set Digit Timeout to 10 seconds
exten => s,4,ResponseTimeout(20)        ; Set Response Timeout to 20 seconds
exten => s,5,Background(vm-extension)    ; "Thanks for calling press 1 for sales, 2 for support, ..."
exten => t,1,Hangup

; Allow incoming calls from the outside to dial our internal extensions
;
include => extensions

[toll-trunks]
;
; Outbound 1-nxx-nxx-xxxx goes via: PSTN
;

exten => _91NXXNXXXXXX,1,Dial(Zap/g1/${EXTEN:1})
exten => _91NXXNXXXXXX,2,Congestion
exten => _9011.,1,Dial(Zap/g1/${EXTEN:1})
exten => _9011.,2,Congestion

[local-trunks]
;
; Outbound to nxx-xxxx goes via: PSTN
;

exten => _9NXXXXXX,1,Dial(Zap/g1/${EXTEN:1})
exten => _9NXXXXXX,2,Congestion

;

[local-access]
;
; Extensions that are this context are allowed to only call local PSTN numbers and other extensions
;
include => extensions
include => local-trunks         ; Access to Local numbers

[toll-access]
;
; Extensions that are this context are allowed to call local and long distance PSTN numbers and other extensions
;
include => local-access         ; Everything local-access has
include => toll-trunks          ; Access to toll numbers