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 // \\ /( )\ ^'~'^
----- Original Message ----- From: "Lance Arbuckle" <asterisk@arbuckle.org> To: <asterisk-users@lists.digium.com> Sent: Monday, December 29, 2003 2:16 PM Subject: [Asterisk-Users] after hours logic> 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 :)Go to your console, and type show application GotoIfTime> > ;************* > [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 >If "billing", "support", and "sales" are your users/extensions, go back to the asterisk pdf, or the wiki and look up macro's. Actually, you'll probably be interested in them to clean up that section anyway... ----- Andrew Thompson http://aktzero.com/ Your eyes are weary from staring at the CRT. You feel sleepy. Notice how restful it is to watch the cursor blink. Close your eyes. The opinions stated above are yours. You cannot imagine why you ever felt otherwise.
Hi Lance, Watch your voicemail-busy line. The step count looks like it's wrong. It's never fun to track down a little problem like that! Sean -----Original Message----- From: Lance Arbuckle [mailto:asterisk@arbuckle.org] Sent: Monday, December 29, 2003 6:48 PM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] after hours logic Andrew Thompson wrote:> Yes, move your GotoIfTime logic into the macro. Then any call to thatmacro> would be subject to that rule. > > However, in that case, you might want to match against internal > extensions(inside the macro) so that you can still call desk-to-desk after > hours.I think I understand how to move the GotoIfTime into the exten macro but I hadn't thought of the problem that wuld cause for calling desk-to-desk after hours. Could you give an example of what you're referring to when you say to "match against internal extensions(inside the macro)". I'm not quite following that statement. [macro-stdexten] ; ; Standard extension macro: ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well ; ${ARG2} - Device(s) to ring ; ; Ring the interface, 20 seconds maximum exten => s,1,GotoIfTime(8:00-21:30|mon-fri|*|*?s,3) exten => s,2,Goto(s,4) exten => s,3,Dial(${ARG2},20) exten => s,4,Voicemail(u${ARG1}) exten => s,5,Hangup exten => s,103,Voicemail(b${ARG1}) exten => s,104,Hangup -- .~. /V\ Lance C. Arbuckle // \\ /( )\ ^'~'^ _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users