Actions

Difference between revisions of "Scripts (Edge)"

From Zenitel Wiki

(Created page with "{{E}} Script (Virtual I/O) is a feature for activating scripts on station events. The supported script languages are Lua and bash. A station can be triggered, e.g. by DTMF or...")
 
Line 24: Line 24:
  
 
<br>
 
<br>
 
 
=== Script Configuration ===
 
=== Script Configuration ===
 
* Select '''Edge Configuration''' > '''Script'''
 
* Select '''Edge Configuration''' > '''Script'''
Line 49: Line 48:
  
 
<br>
 
<br>
 
 
=== Script Events ===
 
=== Script Events ===
 
*Select '''Edge Configuration''' > '''Script Events'''
 
*Select '''Edge Configuration''' > '''Script Events'''

Revision as of 13:08, 7 January 2020

Edge-icon.jpg

Script (Virtual I/O) is a feature for activating scripts on station events. The supported script languages are Lua and bash. A station can be triggered, e.g. by DTMF or an input to execute scripts towards other systems, e.g. access control systems. These scripts can be uploaded and configured via the menu options:

  • Script Upload
  • Script
  • Script Events

Requirements

Note icon INCA stations do not support Virtual I/O.


OBS icon
  • As from version 5.1.3.0 Virtual I/Os are by default disabled. To enable, enter in the web browser the url "http://<IP Address>/goform/zForm_webcall", and check the flag Enable Web Call and Relay



Script Upload

To start with, a script should be uploaded to the station. It is possible to download scripts from the station by clicking its Name. Scripts are kept during a software upgrade process.

  • Select Edge Configuration > Script Upload
Script Upload


  • Upload Script: Click Browse to upload the desired script


Script Configuration

  • Select Edge Configuration > Script
Script Configuration


After uploading a script the user must configure a script slot (Slot 1 - Slot 10). First, assign a logical name to the script in the Assign a Label field. Then, enter the script to activate and add parameters in the text field under Enter script in selected slot (note that shell scripts don’t need to be uploaded as it is possible to write the script direclty in the text field). Lua scripts have the followings syntax:

lua <scriptname> <parameter1> <parameter2> <parameter3> ....

Shell scripts follow the same syntax, but starts with sh:

sh <scriptname> <parameter1> <parameter2> <parameter3> ...

The uploaded scripts should clearly state which parameters are needed in the beginning of the file.

The example shown in the screenshot above has 4 parameters: username, password, the IP address of turbine station, and Virtual I/O (gpio1 - gpio6) to activate. The parameter values in the example are:

  • Username = admin
  • Password = alphaadmin
  • IP address = 10.9.7.10
  • Output = 1
Note icon To be able to use Output, the pin connector needs to be changed to output. This can be done in Edge Configuration > I/O, and change the selected I/O Pin to Output



Script Events

  • Select Edge Configuration > Script Events

After a script slot has been created, you need to configure which Event that should Execute the script.

In the example below, the script "Activate Output" will be executed when the station receives DTMF digit #3 from the remote station:

Script Events


If there is a need to delay the execution of the script, one can choose a time in seconds in the field "after a duration of".


Examples