Jump to content
Tom Wellige

Usecases for persistent variables

Recommended Posts

The following forum topic is restored from the Swyx Forum Archive (2007-2014)

 

Quote

2011-03-26 14:15:14, Tom Wellige

 

It seems to me that although often requested it is not widely understood, what persistent variables are and what can be done with them.

 

The first question, what persistent variables are, is answered in the project page. How to use them is in detail explained in the project documentation.

 

So the remaining question is: what to do with them?

 

The project already provides one quite useful example, an often requested and needed nightswitch.

 

What else could they be used for? Let's try to get a list of some ideas. This list of course can't be complete, as it does contain my current ideas only. Please feel free to use this forum thread to add your ideas and requirements as well!

 

  • Global (same) redirection for more than one user
    • A script will set two (global) persistent variables, one that keeps the status of the global redirection (0 for off, 1 for on) and another one that keeps the redirection target. The script will make use of the GSE's DTMF blocks for enabling and disabling the global redirection as also to receive the redirection target.
    • Each needed user gets a script (on top of the list of call routing rules) that checks these global variables:
      • if enabled: use a Connect To block to connect the call to the stored redirection target. Afterwards leaving the rule through the Rule Executed exit.
      • if disabled: exit the script through the Rule Skipped exit to allow the other rules to handle the call.
         
  • Announcement of a most recent (numerical) status
    This can be used to announce e.g. last Saturday's lottery numbers, a currently valid emergency number (if it rotates), a temperature, humidity, rain possibility, radioactivity or what ever.
    An entitled user will be able to call a certain extension and enter the numbers via DTMF. Afterwards they can be announced by another script (of another extension/user).
    • A script will receive the numbers and store them into persistent variable(s) by using the Get DTMF String block.
    • Another script will read the numbers from the persistent variable(s) and announce them by using the Say Number block.
       
  • Changing announcements
    If you need to be able to switch easily between pre-recorded announcements the above example can be used for something like that as well. The only difference would be that for the modifier you provide a DTMF menu to select an announcement and afterwards store the name of the wav file into a persistent variable.
     
  • Remember the latest caller
    If it is necessary to remember the latest caller because if he calls in right again the PBXCall.CallingPartyNumber can be stored into a persistent variable. This variable can be checked on each new call with the current calling party number and if equal do some special call handling.
     
  • What else?
     

Please feel free to add to this thread your ideas or needs in certain situations.
 

Have a nice weekend, Tom.

 

Quote

 

2012-01-20 15:38:34, Xanacas

  

I use the persistent variables for example rotate the advertise-announcements during the call is in the queue:


Musik = "Wartemusik" & Wartemusik.Value & ".wav"

IF Wartemusik.Value = 5 THEN
	Wartemusik.Value = 1
ELSE
	Wartemusik.Value = Wartemusik.Value + 1
END IF

 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

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