[Asterisk-Users] Nightsettings

Michiel Betel michiel at betel.nl
Tue Apr 1 07:22:07 MST 2003


Based on James suggestion to use the DB functions I made the following and
thought it might be nice to share:
;
exten => s,1,DBget($Night=GlobalSettings/Night) ; if not night jump to +101
exten => s,2,Goto(closed,s,1) ;Night has been set, we're closed
exten => s,102,Goto(open,s,1) ;Night has not been set so we are open
;
; night settings
; calling 6502 toggles the Night-settings
;
exten => 6502,1,Authenticate(/etc/asterisk/password.conf)
exten => 6502,2,DBget($Night=GlobalSettings/Night) ; if not night then set it
exten => 6502,3,DBdel(GlobalSettings/Night)
exten => 6502,4,Playback(night_off)
exten => 6502,5,Hangup
exten => 6502,103,DBput(GlobalSettings/Night=true)
exten => 6502,104,Playback(night_on)
exten => 6502,105,Hangup





More information about the asterisk-users mailing list