Jump to content

- Properties & Methods

- # Persistent Variables - 4.7 - GroupID

  Followers 0

  VBScript 1.4.0

  The usual way of working with persistent variables is most likely from within a call routing script. From v1.1.0 the persistent variables can also be used outside of a call routing script, i.e. in a standard windows scripting file (.wsf) or an asp web page.

  In these cases the persistent variables switch their default Scope from User/Group to Global to reflect the fact, that they don't have access to a SwyxWare user id or group id, and therefore can't use the User or Group Scope automatically.

  If for what reason ever you need to access a persistent variable in the group scope of a certain group from outside a call routing script, you need to specify the SwyxWare group id belonging to that group and switch the scope to Group:

      <package>
      <job id="set_variable_in_user_scope">
      <script language="VBScript" src="PersistentVariables.vbs"/>
      <script language="VBScript">

      Dim Announcement
      Set Announcement     = new PersistentVariable
      Announcement.Name    = "Welcome"
      Announcement.Scope   = SCOPE_GROUP
      Announcement.GroupID = 3

      Announcement.Value   = "Beep.wav"

      Set Announcement     = Nothing

      WScript.Quit

      </script>
      </job>
      </package>

  If you save the above code into a text file and name it SetAnnouncement.wsf you can call it directly from the command prompt: (the PeristentVariables.vbs file needs to be in the same folder!)

      C:\PersistentVariables> SetAccouncement

  The above example demonstrates the usage of persistent variables in a standard windows scripting host file (.wsf).

  There are many way to figure the group id of a SwyxWare group:

  - Assuming you are accessing the variable also from inside a call routing script you can simply take a look into the PersistentVariables table and take the group id from there.
  - You can also trace it into the server trace file from within a call routing and read it from there.
  - Use any of the SwyxWare APIs (Server Script API, Client SDK, ConfigDataStore SDK, Powershell) to obtain it from SwyxWare.
  - ...

  Please find a complete explanation of the usage of persistent variables outside of call routing scripts here:

  - 6.6 - Usage of Persistent Variables outside of a call routing script

  By Tom Wellige

  - February 29, 2024
  Share
  Share
  Followers 0
  Previous Page 4.6 - UserID
  Next Page 4.8 - CallerName

## 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.