Not Logged in - No Account?

Don't have an account? Registering an account with us allows you to post to the forums, easily track new posts, subscribe to threads, pm (private message) other forum members, and receive periodic news letters (you can opt out if you desire). Once you are logged in this message will no longer appear. If you don't have an account, you can create one by registering here. Lost your password, request a new password. We respect your privacy which means we collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for full details.


Using the Day/Night Control with a Time Condition

p_lindheimer's picture

Overriding a Time Condition with a feature code is a request that has been asked for since as long as Time Conditions have been available in FreePBX. It comes up regularly on the forums and there have been many custom versions implemented and posted to solve this problem. We have introduced a Day/Night Control module to provide this ability as mentioned in an announcement a few weeks ago.

The module has been put into FreePBX version 2.3 and we hope by now has gotten plenty of testing. Some users were confused on how to use this module in conjunction with a Time Condition so we felt a short write-up in our technical series is in order.

The Day/Night Control module is similar to many other modules in the system. You can create multiple daynight feature codes and each can be used as a destination from within FreePBX as well as provide two destinations of their own. The feature code itself is nothing more than a two way toggle switch. You can change it to either DAY or NIGHT and the state is toggled each time you dial the feature code.

Let’s walk through a standard example of how one might use this in conjunction with an existing Time Condtion. You have an Inbound Route for your main Company DID, that points to a Time Condition set to ring your receptionist at queue 1200 during the normal business hours of 8:00am to 5:00pm Monday-Friday. After hours, it rings the After Hours IVR. You would like to provide an ability to override the Time Condition with a daynight feature code.

How do we do this when there is no reference to the Time Condition in the Day/Night Control module. Lets step through this example and see how:

  1. Create our new daynight feature code and give it index 0 (or what ever you prefer).
  2. Give this a useful name: Receptionist Override
  3. Set the current mode you want this to be in after hitting submit (probably Day).
  4. Provide an optional Password if you want to require password access to this feature code.
  5. Under DAY destination, choose the Receptionist Time Condition
  6. Under NIGHT destination, choose After Hours IVR
  7. Press Save
  8. Go to the Inbound Route that was pointing to the Time Condition and change it to point to your newly created Receptionist Override Day Night mode destination.

That’s it. What you have created looks like this:

 

DayNightTimeCondition

 

Example of Day/Night Control Feature Code used with a Time Condition

 

Now you can dial *280, optionally entering a password if configured, and change between the Day mode, where the call continues to be controlled by the Time Condition, or the Night mode, where the call is routed around the Time Condition to the normal After Hours IVR.

Accessing the Day/Night Control from Outside

Down in the comments Dirk brought up and excellent question. He needs to be able to enable/disable the feature code from an outside line: "but how can I do this from an outside line?" Normally you would define a Misc Destination to this feature code and then point a DID or IVR option to that destination. However, it turns out this wasn't really implemented quite right to allow you to do this (mental note - change that in a future release...). However, you can still use the Misc Destination module to accomplish this task. Here's how:

  1. Go to the Misc Destinations Module
  2. Type in a meaningful description: Receptionist Override
  3. In the Dial Box type: *280
  4. Now use this Misc Destination as a destination for an Inbound Route, IVR selection, or other means.
The downside to this is that a change in the default Misc Destination feature code (from *28) will not reflect in this and you would have to go back and manually make the change here also. We will look at making this more standard, so that each feature code shows up in the Feature Code list in a future release.

There are plenty of other ways you can use the daynight feature code and there is no need to do it in conjunction with a Time Condition. It is simply a module that can be chosen as a destination by other modules and provides a two way toggle switch to continue the call routing to either its Day or Night destinations. As always, we hope that you enjoy these technical series and would very much like to see some suggestions of what you would like to read about (or we may decide no one is reading these and stop writing...).

--Philippe


Related Content


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Wow!

jsearles's picture

I just stumbled across this and wow!. It took all of 2 minutes to get it working. I immediately called over to one of our company night owls who likes to take orders late on Fridays and they were ecstatic to have this excellent feature. Now, in that I know that they will also walk out most evenings and forget to change it back, I suppose there is a way to automatically turn it off or to just turn it on for a specified period of time. If not, then this feature still rocks. Thanks a million.


Day Night Toggle

PhoneCom's picture

Is there any way of knowing what 'state' the System is in from looking a Phone ? Please don't stop writing these technical Series!They are very informative and useful.


Day Night Toggle

brandonsfish's picture

There appears to be a patch here http://www.freepbx.org/trac/ticket/2273 that sets the DEVSTATE of daynight to INUSE or NOT_INUSE

You can then set an exten ==>
and set a BLF to that via these instructions http://www.asterisk.org/node/48325

I'm not so great with code so I am not the one to figure out how to map those together and actually make it work; but I am anxiously awaiting someone to figure it out. Maybe in 1.0.2.5 there will be an easier way.


Toggle 2 Day/Night Controls together

mikeh's picture

Hi!

Is it possible to toggle 2 Day/Night Controls together with one feature code?

TIA,
Mike


Toggle Day/Night

labesys's picture

I put *280 on my Phone but I ear a message than says "This feature is not avaliable on this line..."
What's up?


Toogle Day/Night

labesys's picture

I have FreePBX 2.6.0 and PAP2 of Linksys with my phone...!