[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
CONSOLE=Console/dsp ; Console interface for demo
TRUNK=Zap/g1 ;PSTN = Channel 1-8
PHONE_09=Zap/9 ;TEL1 = Channel 9
PHONE_10=Zap/10 ;TEL2 = Channel 10
PHONE_11=Zap/11 ;TEL3 = Channel 11
PHONE_12=Zap/12 ;TEL4 = Channel 12
PHONE_13=Zap/13 ;TEL5 = Channel 13
PHONE_14=Zap/14 ;TEL6 = Channel 14
PHONE_15=Zap/15 ;TEL7 = Channel 15
PHONE_16=Zap/16 ;TEL8 = Channel 16
PHONE_17=Zap/17 ;TEL9 = Channel 17
PHONE_18=Zap/18 ;TEL10 = Channel 18
PHONE_19=Zap/19 ;GYM = Channel 19
PHONE_20=Zap/20 ;GSM = Channel 20
PHONE_21=Zap/21 ;PANA CO1 = Channel 21
PHONE_22=Zap/22 ;PANA CO2 = Channel 22
PHONE_23=Zap/23 ;PANA CO3 = Channel 23
PHONE_24=Zap/24 ;PANA CO4 = Channel 24
SIP_0=SIP/operator
SIP_5168=SIP/one
SIP_5100=SIP/two
SIP_5101=SIP/three
SIP_5200=SIP/four
SIP_5202=SIP/five
SIP_5300=SIP/six
SIP_5301=SIP/seven
SIP_5302=SIP/eigth
SIP_5400=SIP/nine
SIP_5406=SIP/ten
SIP_5407=SIP/eleven
SIP_5408=SIP/twelve
SIP_5409=SIP/thireteen
SIP_5500=SIP/fourteen
SIP_5501=SIP/fifteen
SIP_5502=SIP/sixteen
SIP_5600=SIP/seventeen
SIP_5601=SIP/eten
SIP_5700=SIP/9ten
SIP_5701=SIP/twenty
SIP_5702=SIP/twenty1
SIP_5703=SIP/twenty2
SIP_5800=SIP/twenty3
SIP_5801=SIP/twenty4
SIP_5802=SIP/twenty5
IAX2_5338=IAX2/dan
IAX2_5339=IAX2/gam
[incoming]
exten => s,1,Set(i=1)
exten => s,2,Answer()
exten => s,3,Background(silence/1)
exten => s,4,Background(welcome)
exten => s,5,WaitExten(15|m)
exten => 1,1,Goto(yyk,1,1)
exten => 1,2,Goto(incoming,s,2)
exten => 2,1,Goto(yyk,2,1)
exten => 2,2,Goto(incoming,s,2)
exten => 3,1,Goto(yyk,3,1)
exten => 3,2,Goto(incoming,s,2)
exten => 8,1,Goto(yyk,8,1)
exten => 8,2,Goto(incoming,s,2)
exten => 0,1,Goto(internal,0,1)
exten => 0,2,Goto(incoming,s,2)
exten => *,1,Answer()
exten => *,2,DISA(no-password|internal)
exten => *,3,Goto(incoming,s,2)
exten => i,1,While($[${i} < 3])
exten => i,n,Playback(pbx-invalid)
exten => i,n,SayNumber(${i})
exten => i,n,Set(i=$[${i} + 1])
exten => i,n,Goto(incoming,s,2)
exten => i,n,EndWhile
exten => i,n,Playback(vm-goodbye)
exten => i,n,Hangup()
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup()
[yyk]
exten => 1,1,Answer()
exten => 1,2,agi,english_inquiry.php
exten => 1,3,Goto(incoming,s,1)
exten => 1,4,Hangup()
exten => 2,1,Answer()
exten => 2,2,agi,tagalog_inquiry.php
exten => 2,3,Goto(incoming,s,1)
exten => 2,4,Hangup()
exten => 3,1,Answer()
exten => 3,2,Goto(department,s,1)
exten => 3,3,Hangup()
exten => 8,1,Answer()
exten => 8,2,MP3Player(/var/lib/asterisk/mohmp3/slowrock/greenday_wakemeup.mp3)
exten => 8,3,Hangup()
[department]
exten => s,1,Answer()
exten => s,2,Background(silence/1)
exten => s,3,Background(dept_ivr) ;if you want to Connect to BD…and so on
exten => s,4,WaitExten(15|m)
exten => 1,1,Goto(internal,5100,1)
exten => 1,2,Goto(department,s,1)
exten => 2,1,Goto(internal,5300,1)
exten => 2,2,Goto(department,s,1)
exten => 3,1,Goto(internal,5200,1)
exten => 3,2,Goto(department,s,1)
exten => 7,1,Goto(internal,5600,1)
exten => 7,2,Goto(department,s,1)
exten => 8,1,Goto(internal,5500,1)
exten => 8,2,Goto(department,s,1)
exten => 9,1,Goto(incoming,s,1)
exten => 9,2,Goto(department,s,1)
exten => 0,1,Goto(internal,0,1) ;Operator
exten => 0,2,Goto(department,s,1)
exten => *,1,Answer()
exten => *,2,DISA(no-password|internal)
exten => *,3,Goto(department,s,2)
exten => i,1,While($[${i} < 3])
exten => i,n,Playback(pbx-invalid)
exten => i,n,SayNumber(${i})
exten => i,n,Set(i=$[${i} + 1])
exten => i,n,Goto(incoming,s,2)
exten => i,n,EndWhile
exten => i,n,Playback(vm-goodbye)
exten => i,n,Hangup()
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup()
[internal]
include => macro-voicemail
include => redit_sip
include => redit_iax2
ignorepat => 9
exten => 5900,1,Answer()
exten => 5900,2,DISA(no-password|internal)
exten => 1,1,Goto(yyk,1,1)
exten => 2,1,Goto(yyk,2,1)
exten => 3,1,Goto(yyk,3,1)
exten => 8,1,Goto(yyk,8,1)
exten => 0,1,Macro(voicemail,${SIP_0}) ;operator
exten => 5001,1,Macro(voicemail,${PHONE_09}) ;Channel_9
exten => 5003,1,Macro(voicemail,${PHONE_10}) ;Channel_10
exten => 5004,1,Macro(voicemail,${PHONE_11})
exten => 5006,1,Macro(voicemail,${PHONE_12})
exten => 5008,1,Macro(voicemail,${PHONE_13})
exten => 5100,1,Macro(voicemail,${PHONE_14})
exten => 5200,1,Macro(voicemail,${PHONE_15})
exten => 5300,1,Macro(voicemail,${PHONE_16})
exten => 5400,1,Macro(voicemail,${PHONE_17})
exten => 5500,1,Macro(voicemail,${PHONE_18})
exten => 5555,1,Answer() ;GYM
exten => 5555,2,Dial(${PHONE_19},30)
exten => 5555,3,Playback(vm-nobodyavail)
exten => 5555,4,Hangup()
;exten => 123,1,Answer
;exten => 123,n,Set(i=1)
;exten => 123,n,While($[${i} < 5])
;exten => 123,n,SayNumber(${i})
;exten => 123,n,Set(i=$[${i} + 1])
;exten => 123,n,EndWhile
exten => 09279928279,1,Goto(5444,1)
exten => 09279928279,2,Hangup()
;exten => 09279928279,1,Dial(${PHONE_20},10) ;GSM
;exten => 09279928279,2,Hangup()
exten => *123,1,Macro(voicemail,${PHONE_21}) ;To PANA CO1
exten => *124,1,Macro(voicemail,${PHONE_22}) ;To PANA CO2
exten => *125,1,Macro(voicemail,${PHONE_23}) ;To PANA CO3
exten => *126,1,Macro(voicemail,${PHONE_24}) ;To PANA CO4
;Retrieve voicemail
exten => 888,1,Answer()
exten => 888,2,VoiceMailMain(@redit_voicemail)
exten => 888,3,Hangup()
;conference
exten => 8000,1,Goto(conf,1)
exten => conf,1,Set(MEETME_RECORDINGFILE=/tmp/Tutorial-$ {TIMESTAMP})
exten => conf,2,Meetme(8000|sr)
exten => conf,3,Hangup()
exten => 1337,1,Goto(count,1)
exten => count,1,MeetMecount(1234|USERS)
exten => count,2,NoOp(Total: ${USERS} users)
;
; barge monitoring extension
exten => 889,1,ZapBarge
exten => 889,2,Hangup
[redit_sip]
exten => 5168,1,Macro(voicemail,${SIP_5168})
exten => 5100,1,Macro(voicemail,${SIP_5100})
exten => 5101,1,Macro(voicemail,${SIP_5101})
exten => 5200,1,Macro(voicemail,${SIP_5200})
exten => 5202,1,Macro(voicemail,${SIP_5202})
exten => 5300,1,Macro(voicemail,${SIP_5300})
exten => 5301,1,Macro(voicemail,${SIP_5301})
exten => 5302,1,Macro(voicemail,${SIP_5302})
exten => 5400,1,Macro(voicemail,${SIP_5400})
exten => 5401,1,Macro(voicemail,${SIP_5401})
exten => 5406,1,Macro(voicemail,${SIP_5406})
exten => 5407,1,Macro(voicemail,${SIP_5407})
exten => 5408,1,Macro(voicemail,${SIP_5408})
exten => 5409,1,Macro(voicemail,${SIP_5409})
exten => 5500,1,Macro(voicemail,${SIP_5500})
exten => 5501,1,Macro(voicemail,${SIP_5501})
exten => 5502,1,Macro(voicemail,${SIP_5502})
exten => 5600,1,Macro(voicemail,${SIP_5600})
exten => 5601,1,Macro(voicemail,${SIP_5601})
exten => 5700,1,Macro(voicemail,${SIP_5700})
exten => 5701,1,Macro(voicemail,${SIP_5701})
exten => 5702,1,Macro(voicemail,${SIP_5702})
exten => 5703,1,Macro(voicemail,${SIP_5703})
exten => 5800,1,Macro(voicemail,${SIP_5800})
exten => 5801,1,Macro(voicemail,${SIP_5801})
exten => 5802,1,Macro(voicemail,${SIP_5802})
[redit_iax2]
exten => 5338,1,Answer()
exten => 5338,2,MixMonitor(test.wav|bv(0)V(0))
exten => 5338,3,Dial(IAX2/daemon)
exten => 5338,4,Hangup()
;outbound
exten => _NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
exten => _NXXXXXX,2,Congestion();Plays a fast busy signal if call failed for some reason
exten => _NXXXXXX,102,Congestion();Also play signal if got a busy signal
;exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
;exten => _9NXXXXXX,2,Congestion();Plays a fast busy signal if call failed for some reason
;exten => _9NXXXXXX,102,Congestion();Also play signal if got a busy signal
;Mobile Phone
exten => _91XX,1,Dial(${TRUNK}/${EXTEN:1})
exten => _91XX,2,Congestion();Plays a fast busy signal if call failed for some reason
exten => _91XX,102,Congestion();Also play signal if got a busy signal
[macro-voicemail]
exten => s,1,Dial(${ARG1},20,tM(record_conversation))
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(u${MACRO_EXTEN}@redit_voicemail)
exten => s-NOANSWER,2,Goto(incoming,s,1)
exten => s-BUSY,1,Voicemail(b${MACRO_EXTEN}@redit_voicemail)
exten => s-BUSY,2,Goto(incoming,s,1)
exten => _s-.,1,Goto(s-NOANSWER,1)
[macro-record_conversation]
exten => s,1,Set(RECORDED_CONVERSATION=${DIALEDPEERNUMBER}${TIMESTAMP})
exten => s,n,System(chmod 777 /var/spool/asterisk/monitor)
exten => s,n,MixMonitor(${RECORDED_CONVERSATION}.wav|bv(1)V(1))
exten => s,n,StopMonitor()