Jump to content
Tom Wellige

A.2 - Appendix A - Example Night Switch - Night Switch enabled call routing script

Recommended Posts

Download the latest version of this example.

 

This script is an example to show how to use the Night Switch in any call routing script of any user.

 

How to install it

  • Make sure you have the Persistent Variables extension installed
  • Open Call Routing Manager of the user you want a Night Switch enabled call routing script for
  • Create a new rule using the GSE
  • Import the file NightSwitchEnabledScript.rse from the download package
  • Save the rule and exit the GSE

 

How to use it

 

Just call the user. If the night switch is off the call will be connected to the user. If the night switch is on you will end up in his voicemail.

 

 

How it works

 

image.png

 

The persistent variable NightSwitch will be initialized. It's global scope makes sure that it can be accessed from any user. The content of the NightSwitch variable will be passed to the exits of the block. If the content is 0 the default exit will be taken, meaning the night switch is off. If the content is 1 the "1" exit will be taken, meaning the night switch is on.

 

The default value of the night switch is 0, meaning if the NightSwitch variable hasn't been set by any other script before (i.e. the Night Switch Manager script) the night switch is off.
 

image.png

 

 

The above mentioned script to manage the status of the night switch can be found here: Night Switch Manager

 

 

Index

<< Previous A.1 - Appendix A - Example Night Switch - Night Switch Manager

>> Next B.1 - Appendix B - Example usage outside call routing - Simple ASP webpage


 

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.