Asterisk Configuration Example - With Branch Offices
 

Sonora Communications, Inc.

  • Increase font size
  • Default font size
  • Decrease font size

Asterisk Configuration Example - With Branch Offices

E-mail Print PDF

********************************************************************************************************
GHendershot Sample Asterisk Config Files
********************************************************************************************************
###############################################################
# Zaptel.Conf
###############################################################


loadzone=us
defaultzone=us
fxoks=1
fxoks=2
fxsks=3
fxsks=4

###############################################################
# Zapata.Conf
###############################################################


[channels]
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
relaxdtmf=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=300
rxgain=10.5
txgain=-3
;faxdetect=incoming
musiconhold=default


signalling => fxo_ks
context => default
group => 1
channel => 1

signalling => fxo_ks
context => default
group => 1
channel => 2

signalling => fxs_ks
context => office-in
group => 2
channel => 3

signalling => fxs_ks
context => office-in
group => 2
channel => 4


################################################################
# Sip.Conf
################################################################


[general]
tos=0x18 maxexpirey=180
defaultexpirey=160
disallow=all
allow=alaw
allow=ulaw
allow=gsm
musicclass=default
musiconhold=default
videosupport=yes
vmexten=5000@default
externip=123.123.123.123
externhost=123.123.123.123
localnet=192.168.1.0/255.255.255.0
register=><username>:<password>@voip-provider-host.com
nat=no
context=inbound-sip
bindport=5060
;
[authentication]
;
auth=<username>:<password>@voip-provider-host.com
;
; Internal IP phones
;
[5000]
;
type=peer
username=5000
secret=wxyzsecret
canreinvite=no
callerid="Troy Sponaugle" <5000>
host=dynamic
bindport=5060
dtmfmode=rfc2833
call-limit=6
incominglimit=6
outgoinglimit=4
insecure=very
canreinvite=yes
qualify=yes
context=default
subscribecontext=internal-sip
pickupgroup=1
callgroup=1
mailbox=5000@default
;
;
[5001]
;
type=peer
username=5001
secret=wxyzsecret
canreinvite=no
callerid="Troy Sponaugle" <5001>
host=dynamic
bindport=5060
dtmfmode=rfc2833
canreinvite=yes
qualify=yes
context=default
pickupgroup=1
callgroup=1
mailbox=5001@default
;
[5002]
;
type=peer
username=5002
secret=wxyzsecret
canreinvite=no
callerid="Jackie Sponaugle" <5002>
host=dynamic
bindport=5060
dtmfmode=rfc2833
canreinvite=yes
qualify=yes
context=default
pickupgroup=1
callgroup=1
mailbox=5002@default
;
[5003]
;
type=peer
username=5003
secret=wxyzsecret
canreinvite=no
callerid="Kalie Sponaugle" <5003>
host=dynamic
bindport=5060
dtmfmode=rfc2833
insecure=very
canreinvite=yes
qualify=yes
context=default
pickupgroup=1
callgroup=1
mailbox=5003@default
;
[5010]
;
; Gary's remote aastra phone
;
type=peer
username=5010
secret=wxyzsecret
host=dynamic
defaultip=branch-office-pbx.com
bindport=5061
mailbox=5010@default
language=en
subscribecontext=internal-sip
context=default
canreinvite=no
dtmfmode=auto
insecure=very
disallow=all
allow=ulaw
qualify=yes
callgroup=1
pickupgroup=1
call-limit=4
incominglimit=4
outgoinglimit=4
callerid="Gary Hendershot" <5010>
;
;
[teliax]
;
type=peer
context=inbound-sip
username=username
fromuser=username
user=username
host=voip-provider-host.com
secret=wxyzsecret
insecure=very
canreinvite=no
qualify=600
call-limit=4
incominglimit=4
outgoinglimit=4
nat=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
;
;


################################################################
# Iax.Conf
################################################################


[general]
;
bandwidth=medium
;
disallow=all
allow=ulaw
allow=alaw
allow=gsm
;
tos=none
;
[office-51]
;
type=friend
host=dynamic
defaultip=branch-office-pbx.nodomain.com
context=default
peercontext=default
username=office-51
secret=wxyzsecret
insecure=very
trunk=yes                     ; Use IAX2 trunking with this host
jitterbuffer=yes              ; Override global setting and enable jitter buffer
timezone=America/New_York     ; Set a timezone for the date/time
qualify=yes                   ; Make sure this peer is alive
qualifysmoothing=yes          ; use an average of the last two PONG
                              ; results to reduce falsly detected LAGGED hosts
                              ; Default: Off
qualifyfreqok=60000           ; how frequently to ping the peer when
                              ; everything seems to be ok, in milliseconds
qualifyfreqnotok=10000        ; how frequently to ping the peer when it's
                              ; either LAGGED or UNAVAILABLE, in milliseconds ;
;

 

 
###############################################################
# Queues.Conf
###############################################################


[general]
;
;
persistentmembers = yes
;
;
[sales]
;
;
musiconhold = default
strategy = roundrobin
timeout = 15
retry = 5
weight=0
wrapuptime=15
maxlen = 4
periodic-announce = hold-or-dial-0
periodic-announce-frequency=15
announce-holdtime = no
joinempty = yes
context = qoutcon
reportholdtime = yes
member => SIP/5000,1
member => SIP/username@teliax/7035551212,2
member => SIP/main-office: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /5100@default,3
;
;
[support]
;
;
musiconhold = default
strategy = roundrobin
timeout = 15
retry = 5
weight=0
wrapuptime=15
maxlen = 4
periodic-announce = hold-or-dial-0
periodic-announce-frequency=15
announce-holdtime = no
joinempty = yes
context = qoutcon
reportholdtime = yes
member => SIP/5000,1
member => SIP/username@teliax/7035551212,2
member =>SIP/main-office: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /5100@default,3
;
;
[accounting]
;
;
musiconhold = default
strategy = roundrobin
timeout = 15
retry = 5
weight=0
wrapuptime=15
maxlen = 4
periodic-announce = hold-or-dial-0
periodic-announce-frequency=15
announce-holdtime = no
joinempty = yes
context = qoutcon
reportholdtime = yes
member => SIP/5000,1
member => SIP/username@teliax/7035551212,2
member => SIP/main-office: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /5100@default,3
;
;
[acctng-support]
;
;
musiconhold = default
strategy = roundrobin
timeout = 15
retry = 5
weight=0
wrapuptime=30
maxlen = 4
periodic-announce = hold-or-dial-0
periodic-announce-frequency=15
announce-holdtime = no
joinempty = yes
context = acctng-support-exit
reportholdtime = yes
member => SIP/5000,1
member => SIP/username@teliax/7035551212,2
member => SIP/main-office: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /5100@default,3
;
;
[network-support]
;
;
musiconhold = default
strategy = roundrobin
timeout = 15
retry = 5
weight=0
wrapuptime=30
maxlen = 4
periodic-announce = hold-or-dial-0
periodic-announce-frequency=15
announce-holdtime = no
joinempty = yes
context = network-support-exit
reportholdtime = yes
member => SIP/5000,1
member => SIP/username@teliax/7035551212,2
member => SIP/main-office: This e-mail address is being protected from spambots. You need JavaScript enabled to view it /5100@default,3
;
;

################################################################
# Extensions.Conf
################################################################


[general]
;
static=yes
writeprotect=no
autofallthrough=no
;
clearglobalvars=no
priorityjumping=no
;
;*************************************************************
; BEGIN - Global variable definitions
;*************************************************************
;
;
[globals]
;
;
CONSOLE=Console/dsp         ; Console interface for demo
TRUNKMSD=1                  ; MSD digits to strip (usually 1 or 0)
;
; External trunk sources
;
TRUNK0 = ZAP/g2             ; this is the PSTN connection 2-lines
TRUNK1 = SIP/teliax         ; this is the SIP host trunk 4 connections max
;
; Line pick up sources
;
OFFICE1 = ZAP/3             ; dial tone provided by house PSTN
OFFICE2 = ZAP/4             ; dial tone provided by office PSTN
EMERGENCY = ZAP/3           ; forced PSTN for 911 calls
;
; Branch office extension layout
;
; OFFICE-50 = Main office extensions 5000 - 5099
; OFFICE-51 = Gary's extensions 5100 - 5199
; OFFICE-52 = ????? exttension 5200 - 5299
;
; 59xx is reserved for conference rooms so the system
; is configured for up to 9 offices sharing dial plan
; using the following extension numbering
;
; 50xx = main office
; 51xx = branch office #1
; 52xx = branch office #2
; 53xx = branch office #3
; 54xx = branch office #4
; 55xx = branch office #5
; 56xx = branch office #6
; 57xx = branch office #7
; 58xx = branch office #8
;
; each office can support 100 extensions
;
; Conference rooms are at extension 59xx as follows
;
; 590x = main office
; 591x = branch office #1
; 592x = branch office #2
; 593x = branch office #3
; 594x = branch office #4
; 595x = branch office #5
; 596x = branch office #6
; 597x = branch office #7
; 598x = branch office #8
;
; each office can support 10 conferences
;
; Default extensions
;
SYSOP = 5000 ; the system operator's extension (default)
;
; Gary's Branch office extensions
;
OFFICE-51 = IAX2/username: This e-mail address is being protected from spambots. You need JavaScript enabled to view it
;
; Troy's extensions
;
TROY-OFFICE = SIP/5000
TROY-CELL = ${TRUNK1}/7035551212
TROY-HOME = ${TRUNK1}/7035551212
;
; Gary's extensions
;
GARY-OFFICE = ${OFFICE-51}/5100@default
GARY-CELL = ${TRUNK1}/7035551212
GARY-HOME = ${TRUNK1}/7035551212
;
; Emergency contact extensions
;
ACCTNG-NORMAL = ${TROY-OFFICE}
ACCTNG-NIGHT = ${TROY-CELL}
ACCTNG-BACKUP = ${GARY-CELL}
;
NETWORK-NORMAL = ${GARY-OFFICE}
NETWORK-NIGHT = ${GARY-CELL}
NETWORK-BACKUP = ${TROY-CELL}
;
; map house/office day/night ring patterns
;
RING-HOUSE-DAY = ${TROY-OFFICE}
RING-HOUSE-NIGHT = ${TROY-OFFICE}
RING-HOUSE = ${TROY-OFFICE}
;
RING-OFFICE-DAY = ${TROY-OFFICE}&${GARY-OFFICE}
RING-OFFICE-NIGHT = ${TROY-OFFICE}
RING-OFFICE = ${TROY-OFFICE}
;
VM = 5000@default
VM-SALES = 5000@default
VM-ACCTNG = 5000@default
VM-NETWORK = ${OFFICE-51}/*5100@default
;
; these are used for call routing and client tracking
;
ACCOUNTCODE=foo
CALLERCODE=foo
DAYSERVICE=foo
;
;*************************************************************
; END - Global variable definitions
;*************************************************************
;
;
;********************************************************************
; BEGIN - Macro Definitions
;********************************************************************
;
[macro-stdexten];
;
; Standard extension macro:
; used to process call to an extension on the system
;
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
; ${ARG2} - Device(s) to ring
;
; Ring the interface, 20 seconds maximum
;
exten => s,1,Dial(${ARG2},20)
;
; Jump based on status (NOANSWER, BUSY, CHANUNAVAIL, CONGESTION, ANSWER)
;
exten => s,2,Goto(s-${DIALSTATUS},1)
;
; If unavailable, send to voicemail w/unavail announce
;
exten => s-NOANSWER,1,Voicemail(u${ARG1})
;
; If they press #, return to start
;
exten => s-NOANSWER,2,Goto(${MACRO_CONTEXT},s,1)
;
; If busy, send to voicemail w/ busy announce
;
exten => s-BUSY,1,Voicemail(b${ARG1})
;
; If they press #, return to start
;
exten => s-BUSY,2,Goto(${MACRO_CONTEXT},s,1)
;
; Treat anything else as no answer
;
exten => _s-.,1,Goto(s-NOANSWER,1)
;
; If they press *, send the user into VoicemailMain
;
exten => a,1,VoicemailMain(${ARG1})
;
;
[macro-stdPrivacyexten];
;
; Standard extension macro:
; used to force caller to enter phone number if no caller ID
;
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
; ${ARG2} - Device(s) to ring
; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)
;
; Ring the interface, 20 seconds maximum, call screening option (or use P for
; databased call screening)
;
exten => s,1,Dial(${ARG2},20|p)
;
; Jump based on status (NOANSWER, BUSY, CHANUNAVAIL, CONGESTION, ANSWER)
;
exten => s,2,Goto(s-${DIALSTATUS},1)
;
; If unavailable, send to voicemail w/unavail announce
;
exten => s-NOANSWER,1,Voicemail(u${ARG1})
;
; If they press #, return to start
;
exten => s-NOANSWER,2,Goto(default,s,1)
;
; If busy, send to voicemail w/ busy announce
;
exten => s-BUSY,1,Voicemail(b${ARG1})
;
; If they press #, return to start
;
exten => s-BUSY,2,Goto(default,s,1)
;
; Callee chose to send this call to a polite "Don't call again" script.
;
exten => s-DONTCALL,1,Goto(${ARG3},s,1)
;
; Callee chose to send this call to a telemarketer torture script.
;
exten => s-TORTURE,1,Goto(${ARG4},s,1)
;
; Treat anything else as no answer
;
exten => _s-.,1,Goto(s-NOANSWER,1)
;
; If they press *, send the user into VoicemailMain
;
exten => a,1,VoicemailMain(${ARG1})
;
;
;********************************************************************
; END - Macro Definitions
;********************************************************************
;
;
;********************************************************************
; BEGIN - INBOUND CALL HANDLING
;********************************************************************
;
;
[inbound-sip]
;
; Inbound Teliax SIP trunk call
;
; if sip call comes in on a DID we know we treat it
; like an inbound office call
;
exten => 7035551212,1,goto(office-in,s,1)
;
; if a sip call comes in from someone we do not know
; we toss 'em out on their ear
;
exten => _X.,1,Answer
exten => _X.,2,Congestion
exten => _X.,3,hangUp
;
;
[inbound-iax]
;
; Inbound Teliax IAX2 trunk call
;
; if an IAX2 call comes in on a DID we know we treat it
; like an inbound office call
;
exten => 7035551212,1,goto(office-in,s,1)
;
; if a sip call comes in from someone we do not know
; we toss 'em out on their ear
;
exten => _X.,1,Answer
exten => _X.,2,Congestion
exten => _X.,3,hangUp
;
;
[office-in]
;
; call can orginate from a VoIP DID or
; from ZAP/4 analog pstn hardware
;
exten => s,1,SetGlobalVar(ACCOUNTCODE=${CALLERID(number)})
exten => s,n,SetMusicOnHold(default)
exten => s,n,goto(office-hours,s,1)
;
;
[house-in]
;
; special handler for inbound calls on house pstn line
; this is handled by ZAP/3 analog hardware port
;
exten => s,1,Wait(2)
exten => s,n,GotoIfTime(08:00-23:59|*|*|*?house-day,s,1)
exten => s,n,Goto(house-night,s,1)
;
;
[house-day]
;
;
exten => s,1,Dial(${RING-HOUSE},30)
exten => s,2,SetGlobalVar(DAYSERVICE=yes)
exten => s,3,Answer
exten => s,4,Goto(house-day-ivr,s,1)
;
;
[house-day-ivr]
;
;
exten => s,1,Background(silence/1)
exten => s,n,Background(if-u-know-ext-dial)
exten => s,n,Background(silence/1)
exten => s,n,Background(to-dial-by-name-press)
exten => s,n,Background(digits/9)
exten => s,n,Background(hold-or-dial-0)
;
; give them 2 seconds between digits
;
exten => s,n,Set(TIMEOUT(digit)=2)
;
; give them 20 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=10)
;
include => external-svc
;
; default voicemail selected
;
exten => _0.,1,VoiceMail(u${SYSOP})
exten => _0.,n,HangUp
;
; dial by name selected
;
exten => _9.,1,Directory(default,internal-ext,f)
;
; send to voicemail on timeout
;
exten => t,1,VoiceMail(u${SYSOP})
exten => t,n,Hangup
;
; "That's not valid, try again"
;
exten => i,1,Background(invalid)
exten => i,n,Wait(1)
exten => i,n,Goto(s,1)
;
;
[house-night]
;
;
exten => s,1,SetGlobalVar(DAYSERVICE=no)
exten => s,3,Answer
exten => s,4,Goto(house-night-ivr,s,1)
;
;
[house-night-ivr]
;
;
exten => s,1,Background(silence/1)
exten => s,n,Background(if-u-know-ext-dial)
exten => s,n,Background(silence/1)
exten => s,n,Background(to-dial-by-name-press)
exten => s,n,Background(digits/9)
exten => s,n,Background(hold-or-dial-0)
;
; give them 2 seconds between digits
;
exten => s,n,Set(TIMEOUT(digit)=2)
;
; give them 20 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=10)
;
include => internal-ext
;
; default voicemail selected
;
exten => _0.,1,VoiceMail(u${SYSOP})
exten => _0.,n,HangUp
;
; dial by name selected
;
exten => _9.,1,Directory(default,internal-vm,f)
;
; send to voicemail on timeout
;
exten => t,1,VoiceMail(u${SYSOP})
exten => t,2,Hangup
;
; "That's not valid, try again"
;
exten => i,1,Background(invalid)
exten => i,2,Wait(1)
exten => i,3,Goto(s,1)
;
;
[office-hours]
;
; test if holiday/closed/open
;
exten => s,1,GotoIfTime(*|*|1|jan?s-CLOSED,1) ; New Years
exten => s,n,GotoIfTime(*|*|4|jul?s-CLOSED,1) ; Fourth of July
exten => s,n,GotoIfTime(*|*|11|nov?s-CLOSED,1) ; Veterans Day
exten => s,n,GotoIfTime(*|*|25|dec?s-CLOSED,1) ; Christmas
exten => s,n,GotoIfTime(*|mon|15-21|jan?s-CLOSED,1) ; MLK Day
exten => s,n,GotoIfTime(*|mon|15-21|feb?s-CLOSED,1) ; Presidents Day
exten => s,n,GotoIfTime(*|mon|26-31|may?s-CLOSED,1) ; Memorial Day
exten => s,n,GotoIfTime(*|mon|1-7|sep?s-CLOSED,1) ; Labor Day
; exten => s,n,GotoIfTime(*|mon|8-17|oct?s-CLOSED,1) ; Columbus Day
exten => s,n,GotoIfTime(*|thu|22-28|nov?s-CLOSED,1) ;Thanksgiving
;
; if its not a Holiday check to see if its during business hours
;
exten => s,n,GotoIfTime(08:30-17:30|mon-fri|*|*?s-OPEN,1)
;
; if its not during business hours, we must be closed
;
exten => s,n,Goto(s-CLOSED,1)
;
; conditional handling based on open/closed status
; only dif between open/closed is if should ring before answer
; we also set the global DAYSERVICE so we test how to respond later
;
exten => s-CLOSED,1,SetGlobalVar(RING-OFFICE=${RING-OFFICE-NIGHT})
exten => s-CLOSED,2,SetGlobalVar(DAYSERVICE=no)
exten => s-CLOSED,3,Goto(office-attendant,s,1)
;
exten => s-OPEN,1,SetGlobalVar(RING-OFFICE=${RING-OFFICE-DAY})
exten => s-OPEN,2,SetGlobalVar(DAYSERVICE=yes)
exten => s-OPEN,3,Dial(${RING-OFFICE},15)
exten => s-OPEN,4,Goto(office-attendant,s,1)
;
;
[office-attendant]
;
;
exten => s,1,Answer
exten => s,2,Background(custom/adt-intro-welcome)
exten => s,3,Goto(office-ivr,s,1)
;
;
[office-ivr]
;
;
exten => s,1,Background(if-u-know-ext-dial)
exten => s,n,Background(silence/1)
;
exten => s,n,Background(for-sales)
exten => s,n,Background(press-1)
;
exten => s,n,Background(for-accounting)
exten => s,n,Background(press-2)
;
exten => s,n,Background(for-tech-support)
exten => s,n,Background(press-3)
;
exten => s,n,Background(to-join-a-meeting)
exten => s,n,Background(press-4)
;
exten => s,n,Background(if-maint-contract-or-emergency)
exten => s,n,Background(press-5)
;
exten => s,n,Background(silence/1)
;
exten => s,n,Background(to-dial-by-name-press)
exten => s,n,Background(digits/9)
;
exten => s,n,Background(to-hang-up)
exten => s,n,Background(press-pound)
;
exten => s,n,Background(silence/1)
;
; give them 2 seconds between digits
;
exten => s,n,Set(TIMEOUT(digit)=2)
;
; give them 10 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=10)
;
include => external
;
; Sales
;
exten => 1,1,Set(foo=${CALLERID(name}})
exten => 1,n,Set(CALLERID(name)=Sales:${foo})
exten => 1,n,Goto(sales-menu,s,1)
;
; Accounting
;
exten => 2,1,Set(foo=${CALLERID(name}})
exten => 2,n,Set(CALLERID(name)=Acctng:${foo})
exten => 2,n,Goto(accounting-menu,s,1)
;
; Tech Support
;
exten => 3,1,Set(foo=${CALLERID(name}})
exten => 3,n,Set(CALLERID(name)=Tech:${foo})
exten => 3,n,Goto(support-menu,s,1)
;
; MeetMe - conferences
;
exten => 4,1,Goto(meeting-menu,s,1)
;
; Service contract
;
exten => 5,1,Set(foo=${CALLERID(name}})
exten => 5,n,Set(CALLERID(name)=Contract:${foo})
exten => 5,n,Goto(contract-menu,s,1)
;
; Directory service - dial by name selected
;
exten => 9,1,Directory(default,default,f)
;
; External user access to voicemail
;
exten => *,1,VoiceMailMain()
exten => *,2,Playback(thank-you-for-calling)
exten => *,3,Hangup
;
; Hang up
;
exten => #,1,Playback(thank-you-for-calling)
exten => #,n,Hangup
;
; Time out - If they take too long, try again
;
exten => t,1,Playback(shall-i-try-again)
exten => t,n,Goto(s,1)
;
; Invalid choice - not valid, try again
;
exten => i,1,Playback(invalid)
exten => i,n,Goto(s,1)
;
;
[sales-menu]
;
;
exten => s,1,Background(sales)
exten => s,2,Background(department)
exten => s,3,GotoIf($["${DAYSERVICE}" = "yes"]?6)
exten => s,4,SetGlobalVar(VM=${VM-SALES})
exten => s,5,Goto(office-closed,s,1)
exten => s,6,Background(pls-hold-while-try)
exten => s,7,Background(silence/1)
exten => s,8,Background(this-call-may-be-monitored-or-recorded)
exten => s,9,Background(for-qc-and-training-purposes)
exten => s,10,Queue(sales)
;
;
[support-menu]
;
;
exten => s,1,Background(technical-support)
exten => s,2,Background(department)
exten => s,3,GotoIf($["${DAYSERVICE}" = "yes"]?6)
exten => s,4,SetGlobalVar(VM=${VM-NETWORK})
exten => s,5,Goto(office-closed,s,1)
exten => s,6,Background(pls-hold-while-try)
exten => s,7,Background(silence/1)
exten => s,8,Background(this-call-may-be-monitored-or-recorded)
exten => s,9,Background(for-qc-and-training-purposes)
exten => s,10,Queue(support)
;
;
[accounting-menu]
;
;
exten => s,1,Background(accounting)
exten => s,2,Background(department)
exten => s,3,GotoIf($["${DAYSERVICE}" = "yes"]?6)
exten => s,4,SetGlobalVar(VM=${VM-ACCTNG})
exten => s,5,Goto(office-closed,s,1)
exten => s,6,Background(pls-hold-while-try)
exten => s,7,Background(silence/1)
exten => s,8,Background(this-call-may-be-monitored-or-recorded)
exten => s,9,Background(for-qc-and-training-purposes)
exten => s,10,Queue(accounting)
;
;
[contract-menu]
;
;
exten => s,1,SetVar(testcallerid=${ACCOUNTCODE})
exten => s,n,Background(this-call-may-be-monitored-or-recorded)
exten => s,n,Background(for-qc-and-training-purposes)
exten => s,n,Background(silence/1)
;
exten => s,n,Background(for-accounting)
exten => s,n,Background(system)
exten => s,n,Background(support)
exten => s,n,Background(press-1)
exten => s,n,Background(silence/1)
;
exten => s,n,Background(to-report-system-network-down)
exten => s,n,Background(press-2)
exten => s,n,Background(silence/1)
;
exten => s,n,Background(press-star)
exten => s,n,Background(T-to-rtrn-to-main-menu)
;
exten => s,n,Background(press-pound)
exten => s,n,Background(to-hang-up-2)
;
; give them 2 seconds between digits
;
exten => s,n,Set(TIMEOUT(digit)=2)
;
; give them 10 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=10)
;
exten => s,n,Background(silence/1)
;
; brach to call queue based on caller selection
;
exten => _1,1,Background(please-wait-connect-oncall-eng)
exten => _1,n,SetGlobalVar(VM=${VM-ACCTNG})
exten => _1,n,Queue(acctng-support)
;
exten => _2,1,Background(please-wait-connect-oncall-eng)
exten => _2,n,SetGlobalVar(VM=${VM-NETWORK})
exten => _2,n,Queue(network-support)
;
; Return to main menu
;
exten => *,1,Goto(office-ivr,s,1)
;
; Hang up
;
exten => #,1,Playback(thank-you-for-calling)
exten => #,n,Hangup
;
; Time out
;
exten => t,1,Playback(shall-i-try-again)
exten => t,n,Goto(s,1) ; If they take too long, give up
;
; Invalid choice
;
exten => i,1,Playback(invalid) ; "That's not valid, try again"
exten => i,n,Goto(s,1)
;
;
[meeting-menu]
;
; caller must know meeting number and provide pin (1234)
;
exten => s,1,Background(enter-conf-call-number)
;
exten => s,n,Background(silence/1)
;
exten => s,n,Background(press-star)
exten => s,n,Background(T-to-rtrn-to-main-menu)
;
exten => s,n,Background(to-hang-up)
exten => s,n,Background(press-pound)
;
exten => s,n,Background(silence/1)
;
exten => s,n,Set(TIMEOUT(digit)=2) ; give them 2
seconds between digits
exten => s,n,Set(TIMEOUT(response)=10) ; give them 20 seconds to make a choice
;
include => internal-conf
;
; Hang up
;
exten => #,1,Playback(thank-you-for-calling)
exten => #,n,Hangup
;
; Back to main menu
;
exten => *,1,Goto(office-open-ivr,s,1)
;
; Time out
;
exten => t,1,Playback(shall-i-try-again)
exten => t,n,Goto(s,1) ; If they take too long, give up
;
; Invalid choice
;
exten => i,1,Playback(invalid) ; "That's not valid, try again"
exten => i,n,Goto(s,1)
;
;
[acctng-support-exit]
;
; send these to Troy's voice mail
;
exten => s,1,Voicemail(u5000)
exten => s,n,HangUp
;
exten => _0,1,Voicemail(u5000)
exten => _0,n,HangUp
;
;
[network-support-exit]
;
; send these to Gary's system voice mail
;
exten => s,1,Dial(${OFFICE-51}/*5100@default)
exten => _0,1,Dial(${OFFICE-51}/*5100@default)
;
;
[qoutcon]
;
; this is the "general" target when exit from a queue reuested
;
exten => s,1,Voicemail(u5000)
exten => s,n,HangUp
;
exten => _0,1,Voicemail(u5000)
exten => _0,n,HangUp
;
;
[office-closed]
;
;
exten => s,1,Background(im-sorry)
exten => s,n,Background(but)
exten => s,n,Background(our-business-hours-are)
exten => s,n,Background(digits/8)
exten => s,n,Background(digits/30)
exten => s,n,Background(digits/a-m)
exten => s,n,Background(through)
exten => s,n,Background(digits/5)
exten => s,n,Background(digits/30)
exten => s,n,Background(digits/p-m)
;
exten => s,n,Background(silence/1)
;
exten => s,n,Background(digits/day-1)
exten => s,n,Background(through)
exten => s,n,Background(digits/day-5)
;
exten => s,n,Background(nbdy-avail-to-take-call)
exten => s,n,Background(silence/1)
;
exten => s,n,Background(press-1)
exten => s,n,Background(T-to-leave-msg)
;
exten => s,n,Background(silence/1)
;
exten => s,n,Background(press-star)
exten => s,n,Background(T-to-rtrn-to-main-menu)
;
; give them 2 seconds between digits
;
exten => s,n,Set(TIMEOUT(digit)=2)
;
; give them 10 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=10)
;
; chose to leave a message in default inbox
;
exten => _1,1,Voicemail(u${VM})
exten => _1,n,HangUp
;
; Back to main menu
;
exten => *,1,Goto(office-ivr,s,1)
;
; Time out
;
exten => t,1,Playback(shall-i-try-again)
exten => t,n,Goto(s,1) ; If they take too long, give up
;
; Invalid choice
;
exten => i,1,Playback(invalid) ; "That's not valid, try again"
exten => i,n,Goto(s,1)
;
;
;********************************************************************
; END - INBOUND CALL HANDLING
;********************************************************************
;
;
;********************************************************************
; BEGIN - Internal Extensions and Services
;********************************************************************
;
;
[default]
;
; this is where internal extensions need to enter the dial plan
;
; give them 2 seconds to between digits
;
exten => s,n,Set(TIMEOUT(digit)=2)
;
; give them 20 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=60)
;
; these are the features available to internal extensions
;
include => internal
include => outbound
;
; Time out
;
exten => t,1,Playback(if-youd-like-to-make-a-call)
exten => t,n,Playback(please-hang-up-and-try-again)
exten => t,n,Congestion
exten => t,n,Hangup
;
; Invalid choice
;
exten => i,1,Playback(feature-not-avail-line) ; "That's not valid, try again"
exten => i,n,Goto(s,1)
;
;
[internal]
;
; These extensions/services are only available
; to internal extensions
;
include => internal-sip
include => internal-zap
include => branch-office
include => internal-vm
include => internal-conf
include => internal-conf-admin
include => internal-svc
include => parkedcalls
;
;
[external]
;
; These extensions/services can be dialed by
; branch office and external callers
;
include => internal-sip
include => internal-zap
include => branch-office
include => internal-vm
include => internal-conf
;
;
[internal-sip]
;
; Transfer to internal SIP phones
;
exten => 5000,hint,SIP/5000
exten => 5000,1,Macro(stdexten,5000,${HINT})
;
exten => 5001,hint,SIP/5001
exten => 5001,1,Macro(stdexten,5001,${HINT})
;
exten => 5002,hint,SIP/5002
exten => 5002,1,Macro(stdexten,5002,${HINT})
;
exten => 5003,hint,SIP/5003
exten => 5003,1,Macro(stdexten,5003,${HINT})
;
exten => 5004,hint,SIP/5004
exten => 5004,1,Macro(stdexten,5004,${HINT})
;
exten => 5010,hint,SIP/5010
exten => 5010,1,Macro(stdexten,5010,${HINT})
;
;
[internal-zap]
;
; Transfer to standard phones connected to ZAP FXS ports
;
; exten => 5010,1,Macro(stdexten,5010,${HINT})
exten => 5011,1,Macro(stdexten,5011,5011)
exten => 5012,1,Macro(stdexten,5012,5012)
;
;
[internal-vm]
;
; Transfer direct to voice mail (* + ExtNo)
;
exten => _*50XX,hint,SIP/${EXTEN:1}
exten => _*50XX,1,Voicemail(u${EXTEN:1})
exten => _*50XX,n,Playback(goodbye)
exten => _*50XX,n,HangUp
;
;
[internal-conf]
;
;
exten => 5900,1,Playback(conf-enteringno)         ; announce conf number
exten => 5900,n,Playback(digits/5)
exten => 5900,n,Playback(digits/9)
exten => 5900,n,Playback(digits/0)
exten => 5900,n,Playback(digits/0)
exten => 5900,n,Playback(conf-thereare)           ; play back "there are"
exten => 5900,n,MeetMeCount,5900                  ; say how many in conf
exten => 5900,n,Playback(conf-peopleinconf)       ; people in conf
exten => 5900,n,Playback(conf-placedintoconf)     ; you will now be
placed into conf
exten => 5900,n,MeetMe,5900|cips
exten => 5900,n,Playback(vm-goodbye)
exten => 5900,n,Hangup
;
exten => 5901,1,Playback(conf-enteringno)         ; announce conf
number
exten => 5901,n,Playback(digits/5)
exten => 5901,n,Playback(digits/9)
exten => 5901,n,Playback(digits/0)
exten => 5901,n,Playback(digits/1)
exten => 5901,n,Playback(conf-thereare)           ; play back "there are"
exten => 5901,n,MeetMeCount,5901                  ; say how many in conf
exten => 5901,n,Playback(conf-peopleinconf)       ; people in conf
exten => 5901,n,Playback(conf-placedintoconf)     ; you will now be placed into conf
exten => 5901,n,MeetMe,5901|cips
exten => 5901,n,Playback(vm-goodbye)
exten => 5901,n,Hangup
;
;
[internal-conf-admin]
;
;
; Admin join conference
;
exten => *5900,1,Playback(conf-enteringno)        ; announce conf number
exten => *5900,n,Playback(digits/5)
exten => *5900,n,Playback(digits/9)
exten => *5900,n,Playback(digits/0)
exten => *5900,n,Playback(digits/0)
exten => *5900,n,Playback(conf-thereare)          ; play back "there are"
exten => *5900,n,MeetMeCount,5900                 ; say how many in conf
exten => *5900,n,Playback(conf-peopleinconf)      ; people in conf
exten => *5900,n,Playback(conf-placedintoconf)    ; you will now be placed into conf
exten => *5900,n,MeetMe,5900|acips|7218
exten => *5900,n,Playback(vm-goodbye)
exten => *5900,n,Hangup
;
exten => *5901,1,Playback(conf-enteringno)        ; announce conf number
exten => *5901,n,Playback(digits/5)
exten => *5901,n,Playback(digits/9)
exten => *5901,n,Playback(digits/0)
exten => *5901,n,Playback(digits/1)
exten => *5901,n,Playback(conf-thereare)          ; play back "there are"
exten => *5901,n,MeetMeCount,5901                 ; say how many in conf
exten => *5901,n,Playback(conf-peopleinconf)      ; people in conf
exten => *5901,n,Playback(conf-placedintoconf)    ; you will now be placed into conf
exten => *5901,n,MeetMe,5901|acips|7218
exten => *5901,n,Playback(vm-goodbye)
exten => *5901,n,Hangup
;
;
[internal-svc]
;
; Services available to internal extensions
;
; Internal user gets voicemail
;
exten => *58,1,VoiceMailMain(${CALLERID(number)}@default|s)
exten => *58,n,Hangup
;
; Used to diagnose menu system
;
exten => *11,1,GoTo(office-attendant|s|1)
exten => *12,1,GoTo(house-in|s|1)
;
; Retreive a speed dial number
;
exten => _*XXX,1,SetVar(speedbin=${EXTEN:1})
exten => _*XXX,2,Goto(get-speed-dial,s,1)
;
; Save a speed dial number
;
exten => _**XXX1NXXNXXXXXX,1,SetVar(speedbin=${EXTEN:2:3})
exten => _**XXX1NXXNXXXXXX,2,SetVar(speednum=${EXTEN:5})
exten => _**XXX1NXXNXXXXXX,3,Goto(put-speed-dial,s,1)
;
;
[branch-office]
;
; transfer/ring branch office extension
;
exten => 5100,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => 5101,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => 5102,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => 5103,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => 5104,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => 5105,1,Dial(${OFFICE-51}/${EXTEN}@default)
;
; transfer directly to vm at branch office
;
exten => *5100,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => *5101,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => *5102,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => *5103,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => *5104,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => *5105,1,Dial(${OFFICE-51}/${EXTEN}@default)
;
; joing a conference at branch office
;
exten => 5910,1,Dial(${OFFICE-51}/${EXTEN}@default)
exten => 5910,1,Dial(${OFFICE-51}/${EXTEN}@default)
;
;
[put-speed-dial]
;
; Put a speed dial number into the database
;
exten => s,1,Playback(for)
exten => s,n,Playback(speed-dial)
exten => s,n,SayDigits(${speedbin})
;
exten => s,n,Playback(the-num-i-have-is)
exten => s,n,SayDigits(${speednum})
exten => s,n,Playback(silence/1)
;
exten => s,n,Playback(if-this-is-correct)
exten => s,n,Playback(press-1)
exten => s,n,Playback(or)
exten => s,n,Playback(hangup-try-again)
;
exten => s,n,Set(TIMEOUT(digit)=5) ; give them 5
seconds between digits
exten => s,n,Set(TIMEOUT(response)=20) ; give them 20 seconds to make a choice
;
exten => 1,1,DBput(speed/${speedbin}=${speednum})
exten => 1,n,Playback(speed-dial)
exten => 1,n,Playback(digits/star)
exten => 1,n,SayDigits(${speedbin})
;
exten => 1,n,Playback(is-set-to)
exten => 1,n,SayDigits(${speednum})
exten => 1,n,Playback(silence/1)
;
exten => 1,n,Playback(goodbye)
exten => 1,n,Hangup
;
; Hang up
;
exten => #,1,Playback(goodbye)
exten => #,n,Hangup
;
; Time out
;
exten => t,n,Goto(#,1) ; If they take too long, give up
;
; Invalid choice
;
exten => i,1,Playback(invalid) ; "That's not valid, try again"
exten => i,n,Goto(s,1)
;
;
[get-speed-dial]
;
; Retreive a speed dial number from the database
;
exten => s,1,DBget(speednum=speed/${speedbin}) ; set speednum to value in bin number
exten => s,n,Playback(speed-dial)
exten => s,n,SayDigits(${speedbin})
exten => s,n,Playback(is-set-to)
exten => s,n,SayDigits(${speednum}})
exten => s,n,Playback(silence/1)
;
exten => s,n,Playback(to-call-this-number)
exten => s,n,Playback(press-1)
exten => s,n,Playback(or)
exten => s,n,Playback(hangup-try-again)
;
; give them 5 seconds to between digits
;
exten => s,n,Set(TIMEOUT(digit)=5)
;
; give them 20 seconds to make a choice
;
exten => s,n,Set(TIMEOUT(response)=20)
;
exten => 1,1,DIAL(${TRUNK1}/${speednum},60,tr))
;
; Hang up
;
exten => #,1,Playback(goodbye)
exten => #,n,Hangup
;
; Time out
;
exten => t,1,Playback(if-youd-like-to-make-a-call)
exten => t,n,Playback(please-hang-up-and-try-again)
exten => t,n,Congestion
exten => t,n,Hangup
;
; Invalid choice
;
exten => i,1,Playback(pbx-invalid) ; "That's not valid, try again"
exten => i,n,Playback(please-hang-up-and-try-again)
exten => i,n,Hangup
;
;
;********************************************************************
; END - Internal Extensions and Services
;********************************************************************
;
;
;********************************************************************
; BEGIN - Outbound Call Handling
;********************************************************************
;
;
[outbound]
;
; Local ten-digit dialing accessed through trunk interface
;
exten => _NXXNXXXXXX,1,Dial(${TRUNK1}/1${EXTEN},120,Tr)
;
; Long distance context accessed through trunk
;
exten => _1NXXNXXXXXX,1,DIAL(${TRUNK1}/${EXTEN},120,Tr))
;
; International long distance through trunk
;
exten => _011.,1,Dial(${TRUNK1}/${EXTEN:1},120,Tr)
;
; Local ten-digit dialing force analog trunk interface
;
exten => _9NXXNXXXXXX,1,Dial(${TRUNK0}/1${EXTEN:1},120,Tr)
;
; Long distance context force analog trunk
;
exten => _91NXXNXXXXXX,1,DIAL($TRUNK0}/${EXTEN:1},120,Tr))
;
; International long distance force analog trunk
;
exten => _9011.,1,Dial(${TRUNK0}/${EXTEN:1},120,Tr)
;
; X11 calls like 911, 411 and so on
;
exten => _N11,1,Dial(${TRUNK0}/${EXTEN},120,Tr)
;
;
;********************************************************************
; END - Outbound Call Handling
;********************************************************************
;
;

Last Updated on Sunday, 06 July 2008 21:36