Zeitabhängige Kontexte
Buch - Scripte

 

Beispiel ohne GotoIfTime Anweisung

[default]
include => tagschicht|7:00-18:00|mon-fri|*|*
include => nachtschicht|18:00-7:00|mon-fri|*|*
include => wochenende|*|sat-sun|*|*

[tagschicht]
exten => 20,1,set(LANGUAGE()=de)
exten => 20,n,Dial(SIP/20,5,tT)
exten => 20,n,Hangup

[nachtschicht]
exten => 20,1,set(LANGUAGE()=de)
exten => 20,n,Dial(SIP/21,25,tT)
exten => 20,n,Hangup

[wochenende]
exten => 20,1,Ringing
exten => 20,n,Wait(3)
exten => 20,n,Playback(weareclosed)
exten => 20,n,Hangup

 

Beispiel mit GotoIfTime Anweisung

[macro-localsip]
exten => s,1,Set(LANGUAGE()=de)
exten => s,2,GotoIfTime(7:00-18:00|mon-fri|*|*?5)
exten => s,3,GotoIfTime(18:00-7:00|mon-fri|*|*?7)
exten => s,4,GotoIfTime(*|sat-sun|*|*?9)

exten => s,5,Dial(SIP/${ARG1},10,tT)
exten => s,6,Hangup

exten => s,7,Dial(SIP/21,10,tT)
exten => s,8,Hangup

exten => s,9,Ringing
exten => s,10,Wait(3)
exten => s,11,Playback(vm-theperson)
exten => s,12,Hangup

[default]
exten => 20,1,macro(localsip,20)