[general]
static=yes
writeprotect=no

[macro-ruf]
exten => s,1,Dial,${ARG1}|30|r
exten => s,n,Goto,s-${DIALSTATUS}|1

exten => s-BUSY,1,voicemail,b${ARG2}
exten => s-BUSY,n,Hangup

exten => s-NOANSWER,1,voicemail,u${ARG2}
exten => s-NOANSWER,n,Hangup

exten => s-CHANUNAVAIL,1,voicemail,u${ARG2}
exten => s-CHANUNAVAIL,n,Hangup

; --------------------------------------------------------------------

[hello_world]
exten => 82,1,Answer()
exten => 82,2,Playback(hello-world)
exten => 82,3,Hangup()

[echotest]
exten => 81,1,answer
exten => 81,2,wait,1
exten => 81,3,playback,demo-echotest
exten => 81,4,echo
exten => 81,5,playback,demo-echodone
exten => 81,6,hangup

[mailbox]
exten => 80,1,answer
exten => 80,n,wait,1
exten => 80,n,voicemailmain
exten => 80,n,hangup

[mailbox_own]
exten => 88,1,answer
exten => 88,n,wait,1
exten => 88,n,voicemailmain,s${CALLERID(num)}
exten => 88,n,hangup

[lokal]
; Erreichbarkeit der lokalen Nebenstellen
; untereinander herstellen

exten => _3X,1,NoCDR()
exten => _3X,n,macro,ruf|SIP/${EXTEN}|${EXTEN}

exten => 41,1,NoCDR()
exten => 41,n,macro,ruf|IAX2/${EXTEN}|${EXTEN}

exten => 51,1,NoCDR()
exten => 51,n,macro,ruf|MGCP/aaln/1@192.168.7.51|${EXTEN}
;exten => 51,n,Dial(MGCP/aaln/1@192.168.7.51,45,rt) 

exten => 52,1,NoCDR()
exten => 52,n,macro,ruf|MGCP/aaln/1@192.168.7.52|${EXTEN}
;exten => 52,n,Dial(MGCP/aaln/1@192.168.7.52,45,rt) 

; --------------------------------------------------------------------

[dusnet_out]
; Rauswählen über den dus.net Account 
exten => _0.,1,Set(CALLERID(num)=497xxxxxxxxx) 
exten => _0.,n,Dial,SIP/${EXTEN}@000387xxxxxx|60|r

[ankommend]
exten => 000387xxxxxx,1,macro,ruf|SIP|31

; --------------------------------------------------------------------

[default]
include => lokal
include => hello_world
include => echotest
include => mailbox
include => mailbox_own
include => dusnet_out

