Wow! This is an old thread and I'm guessing that the OP has either solved their problem by now, or given up.
However, it is entirely possible that this may show up in a search, so thank you to Jim for his well explained solution.
Having said that, I believe that there is an easier way to do this, and no handler modification required! ;-)
So, let us assume we have our Workgroup called "Sales" that we wish to "close" periodically, as requested. (This method can be duplicated for multiple Workgroups, if required.)
- Create a second Workgroup. This needs to be ACD, although it will never actually receive any interactions. I my case, I have named this Workgroup "Sales-Closed". This Workgroup should have, as it's members, all the users who you want to have the ability to "close" or "open" the Sales queue.
- Configure the Access Control Setting on this Workgroup (Security Tab->Access Control) so that all members of the Workgroup have "Activate Self (and probably "Activate Others") for the Workgroup queue. (Select the Sales Workgroup Queue and click "Advanced Access Details").
- In Attendant, create the Workgroup Transfer to the Sales Workgroup and the External Transfer to the external service nodes. Neither should have DTMF digits assigned.
- Create a Logical Transfer node, with the appropriate digit assigned that callers will press for (in this case) "Sales".
- Set the "True" action to be the External Transfer node and the "False" action to be the Workgroup transfer that you created in step 3.
- Click on the "Create Logical Expression" button.
- For Data Type, select "Data about a particular ACD or Custom workgroup" and click "next".
- Select the "Sales-Closed" workgroup
- For "Property to Analyze" choose "Number of Logged In Agents" and click "next"
- Configure the comparison to be "greater than" and "0".
- Publish
- Deactivate all the users in the "Sales-Closed" Workgroup. At this point, when the caller selects the option, the number of logged in agents will be zero, the false exit is taken and the call will go to the Sales Workgroup queue.
When a meeting is called (or whatever the event is causing you to want to "close" the queue) then any of the authorized users simply activate themselves in the Sales-Closed Workgroup. Now, when a caller selects the option, the number of logged in Agents will be greater than zero, the True path be taken and the external transfer will happen.
Once the meeting is over, the users all need to be deactivated again to "reopen" the queue.
Job done, with no handler modifications (which is always the preferred path to take.)
I hope that makes sense. I can post screenshots if anyone needs additional information.