[Asterisk-Users] after hours logic
    Lance Arbuckle 
    asterisk at arbuckle.org
       
    Mon Dec 29 12:16:14 MST 2003
    
    
  
Hi.  I'm new to Asterisk and have been working on setting up a
development server but have gotten myself a bit confused.
I'd like to implement the following logic for calls coming from the
PSTN:
Check for caller-id
  yes    => keep going
  no     => play SIT and prompt for telephone number
Check time of day to see if it's day / night
  day    => ring some phones
            no answer ? => goto auto attendant
            let the caller select an extention
  night  => play special after-hours message
            goto auto attendant
            let the caller select an extention
            BUT, DO NOT RING THE PHONE
            INSTEAD GOTO THE EXTENSION'S UNAVAILABLE VOICEMAIL MESSAGE
  
I think I have a good start on this, but I can't figure out how to
modify the behavior of the extension phones in a manner that will easily
scale above a few extensions.  All I can think of is to have a seperate
[after-hours] context that has different GoTo's but that seems rather
cumbersome.  Any suggestions are welcome.
FLAME away if this is a stupid question :)
;*************
[main-menu]
;*************
exten => s,1,Zapateller(answer|nocallerid) ;play SIT if no Caller-Id
exten => s,2,PrivacyManager                ;prompt for Caller-Id if not
present
                                           ;otherwise goto 103
;check for after-hours
include => night|00:00-7:59|*|*|*
include => night|21:31-23:59|*|*|*
;check for day time
include => day|8:00-21:30|*|*|*
; set some defaults
exten => s,5,SetResponseTimeout,20
exten => s,6,SetDigitTimeout,10
exten => s,7,SetMusicOnHold,default
; the menu
exten => s,8,Playback,intro           ; Thanks for calling....
exten => s,9,Background,instructions  ; Press 1 for xxx, 2 for xxx
;change to something nicer
exten => i,1,Hangup
exten => t,1,Hangup
; the options
exten => 1,1,Goto(Sales,s,1)
exten => 2,1,Goto(Support,s,1)
exten => 3,1,Goto(Billing,s,1)
exten => 9,1,Directory(exten-local)
exten => s,103,Playback (we-dont-accept-calls-from-unknown-callers)
exten => s,104,Hangup
;*************
[day]
;*************
exten => s,3,Dial,Zap/2|20
exten => s,4,NoOp
;*************
[night]
;*************
exten => s,3,Playback (after-hours-message)
exten => s,4,Goto(s,9)
; change extensions to use STDEXTN Macro
;*************
[Sales]
;*************
exten => s,1,Dial,Zap/2|20
exten => s,2,Voicemail,u8000
exten => s,102,Voicemail,b8000
;*************
[Support]
;*************
exten => s,1,Dial,Zap/2|20
exten => s,2,Voicemail,u8001
exten => s,102,Voicemail,b8001
;*************
[Billing]
;*************
exten => s,1,Dial,Zap/2|20
exten => s,2,Voicemail,u8002
exten => s,102,Voicemail,b8002
-- 
  .~.    
  /V\    Lance C. Arbuckle
 // \\   
/(   )\  
 ^'~'^
    
    
More information about the asterisk-users
mailing list