jdzafic Posted June 28, 2023 #1 Share Posted June 28, 2023 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? Link to comment Share on other sites More sharing options...
Tom Wellige Posted June 28, 2023 #2 Share Posted June 28, 2023 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now