We help IT Professionals succeed at work.

IVR and after hours

386 Views
Last Modified: 2013-11-12
Im really struggling with setting up a after hours function in asterisk.

its an appliance AA50, so Ive been using the gui, but changing things manually.

I have 3 menus
Welcome (Main Menu)
FMBH (Business Hours)
FMAH (After Hours)

What is the code for Welcome to make it go to FMAH (after hours outside of 9 - 5.)


comment=Welcome
alias_exten=7000
exten=s,1,Wait(1)
exten=s,7,Answer
exten=s,8,Wait(1)
exten=s,9,Background(stage1)
exten=s,10,WaitExten(10)
include=default
exten=1,1,Goto(voicemenu-custom-2|s|1)
exten=2,1,Goto(voicemenu-custom-3|s|1)

Open in new window

Comment
Watch Question

Commented:
Hi :-)

I can't really tell what the wellcome menu is for, but here is the switch between daytime and other.
You usually implement it without having the user type something, so the switch happens really when the call is answered.

[ivr-switch]
exten => s,1,GotoIfTime(09:00-17:00|mon-fri?FMBH|s|1)
exten => s,1,Goto(BMBH|s|1)

Commented:
sorry - correction
[ivr-switch]
exten => s,1,GotoIfTime(09:00-17:00|mon-fri?FMBH|s|1)
exten => s,2,Goto(FMAH|s|1)

Open in new window

Author

Commented:
welcome is the first menu people get (press 1 for sales 2 for support etc.

Commented:
If I understand correctly, then you would like to skip to FMAH instead of playing the background welcome message (or possibly after).
In the case, just use the "exten=>1" I used anywhere that fits your scenario (immediately after Answer or after playing the welcome message). Just have it jump to FMAH instead of FMBH.

The options in the menu should jump to locations in FMBH.

Usually you don't do it this way, but have the call land on a neutral context, make the switch there and then present the caller with a totally different IVR. Alternatively you can have the incoming context set a variable that contains the sound file to be played and then use one welcome context with the same options.
exten => s,<anywhere>,GotoIfTime(09:00-17:00|mon-fri?FMAH|s|1)

Open in new window

Author

Commented:
If someone calls between the hours of 9am-5pm
 go to FMBH

If call outside of hours go to FMAH.

Author

Commented:
Is this what you meant ABOVE?

Commented:
Yes, but WHEN?
You said you wanted it in the welcome context, in that case I have to know WHEN to include this GotoIf .

Could you explain what the caller should hear/do when calling the office in and our of work hours, with references to the respective context?

Author

Commented:
As soon as someone calls it should check if its between business hours.

The welcome context is the main entry point which says press 1 for sales and 2 for support.

If its inside business hours and I press 1 it will go to FMBH

If its outside business hours and I press 1 it will go to FMAH.

Author

Commented:
let me add to that.

(welcome context)
As soon as someone calls it should check if its between business hours.

The welcome context is the main entry point which says press 1 for sales and 2 for support.

If its inside business hours and I press 1 it will go to FMBH

exten=1,1,Goto(voicemenu-custom-2|s|1)



If its outside business hours and I press 1 it will go to FMAH.
exten
=
2
,
1
,
Goto
(
voicemenu
-
custom
-
3
|
s
|
1
)

Open in new window


Commented:
Sorry- I thought I submitted that yesterday

Though I can't see any references to FMAH and FMBH in your example, here is the code I think you are looking for. You might want to change the targets of the Goto commands to suit your requirements

exten => 1,1,GotoIfTime(09:00-17:00|mon-fri?FMBH|s|1)
exten => 1,2,Goto(09:00-17:00|mon-fri?FMAH|s|1)

Open in new window

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
Any progress/feedback?

Author

Commented:
still trying to work this out.

Commented:
Anything I can help with?

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.