VBScript
As already mentioned using persistent variables is very straight forward, just like you use common VBScript variables.
The only difference is, that the value you put into a persistent variable will automatically be store into the database.
Dim Announcement Set Announcement = new PersistentVariable Announcement.Name = "Welcome" Announcement.Value = "Default Welcome.wav"
The content you want to store into a persistent variable needs to be put into the Value property.
You can put anything you want into the persistent variables, like strings, booleans, integers or dates. You only need to keep in mind that the maximum size is limited to 1kB (1024 bytes).
If the above code is used in a call routing of a user, the variable will be visible/accessible for the current script user only (the User scope is the default scope in this case).
If the above code is used in a call routing of a group, the variable will be visible/accessible for the current script group only (the Group scope is the default scope) in this case.
To configure another scope you have to change the Scope property.
You will find the 3.4 - Simple Script - Store Variable in the download package which includes the above code.
By Tom Wellige