Jump to content

System function to Activate/Deactivate custom rules?


jdzafic
 Share


Recommended Posts

HI @all,

 

I've been searching for a solution to my problem in this forum and other sites, manuals, etc, but I can't find it, so I opened this new thread... 

 

Is there a system function that allows me to activate/deactivate a certain custom-defined rule in a script?

 

For example:

PbxUser.UnconditionalRedirect = 0 and PbxUser.UnconditionalRedirect = 1 will deactivate/activate the 'Unconditional Redirect' for the user (in the below screenshot 'Sofortige Umleitung' because I'm on a german system).

 

Is there a way to activate/deactivate the custom-defined rule "Rufbereitschaft_JD" in the below screenshot in a script?
I'd have hoped that something simple like PbxUser.Rufbereitschaft_JD = 0 and PbxUser.Rufbereitschaft_JD = 1 would work... but that would be too easy, right?

 

 

image.png.6a00088d0c858529ddcd6abc895ef1fe.png

Link to comment
Share on other sites


The redirection settings are something special, as their activation status is kept in the SwyxWare database.

 

Everyhting else however is only known to the Call Routing Manager which takes the activation status to generate VBScript code from it (which is called for every incoming call on the user). So whenever you change the activation status of a rule the Call Routing Manager generates new code for your entire call routing.

 

This is the reason, why it is not possible to enable/disable rules from your list of rules from somewhere else as the Call Routing Manager is always needed to generate new code. It does not provide an API to do that programatically.

 

But there is a solution to this "problem": you can use a Persistent Variable in your script, which keeps the "enable/disable" status and then either performs its stuff or just leaves right again. The Persistent Variables come with an example (Night Switch) which demonstrates exactly this usecase.

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • 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.