Script restrictions

Location path

Path in the build directory

/era_env/priv/sys_metadata/<SOLUTION>/scripts.json (where SOLUTION: master or era)

Overview

Restricts script functionality in the domain.

Sets:

  • the available set of script types and for each of them the available set of component types.

  • the available set of expression evaluator functions.

  • for certain component types it can modify field attributes. For example, set a default value and hide from visibility.

Also available for the master domain (/era_env/priv/sys_metadata/master/scripts.json).

Format:
{
  "components": {
    "loaded": {
      "ivr": [100, 101, ...],
      "svc": [100, 101, ...],
 	  ...
    },
    "fields": {
      "101": {
        "<FIELDNAME>": {
          "default":VALUE,
          "visible":BOOL
        },
        ...
      },
      ...
    }
  },
  "expressions": {
    "functions": ["sin", "cos", ...]
  }
}
  • components – component structure section.

    • loaded – defines available script types and component composition for each of them. Available types: ivr, svc.

    • fields – overrides field visibility and default values for specific components.

  • expressions – expression evaluator access section.

    • functions – defines script access to predefined functions.

Example

Makes ivr and svc scripts available to domains of a specific type. Opens access to the listed components for each of them. For the start component (101) overrides some properties: hides the startParam field and sets a default value for the type field. Opens domain script access to the listed expression functions, hiding access to the rest.

Example:
{
  "components": {
    "loaded": {
      "ivr":[
        100,101,102,103,104,105,106,107,109,110,111,112,115,116,117,120,
        121,122,125,126,140,141,142,143,144,146,147,148,149,
        201,202,203,204,205,206,208,213,214,215,217,218,219
      ],
      "svc":[
        100,101,102,103,104,105,106,107,109,110,111,112,115,116,117,120,
        121,122,125,126,140,141,142,143,144,145,146,147,148,149
      ]
    },
    "fields": {
      "101": {
        "type": {"default":0},
        "defineVars":{"default":1,"visible":true},
        "startParam":{"visible":false}
      }
    }
  },
  "expressions": {
    "functions": [
      "sin","cos","tan","asin","acos","atan","atan2","sinh","cosh","tanh","exp",
      "log","log2","log10","pow","sqrt","erf","erfc","max","min","trunc","round",
      "abs","floor","ceil","lg","ln","sqr","random","newid","len","concat","equal",
      "str","rstr","span","substr","replace","lower","upper","remove","indexof",
      "trim","ltrim","rtrim","trimstart","trimend","left","right","regexreplace",
      "modify_json","translit","nowtick","now","nowutc","nowgregsecond","ticktolocal",
      "ticktoutc","tick","dateformat","date","time","datetime","datediff","year","month",
      "day","hour","minute","second","millisecond","dayofyear","dayofweek",
      "weekofyear","isleapyear","datetimelocal","datetimeutc","localtoutc",
      "utctolocal","valid_date","char","num","numval","dechex","hexdec","ifelse",
      "md5","base64decode","base64encode","urldecode","urlencode","htmlencode",
      "htmldecode","escape","unescape","crc32","adler32","phash2","syn_media",
      "syn_dom_media","syn_domain","syn_script","syn_script_media","ss_public",
      "ss_domain","ss_script","gs_public","gs_domain","gs_script","temp","pathtype",
      "relpath","filename","fileext","filedir","makepath",
      "startparam","getscriptref","scriptcode","domain","get_project_id","cmd",
      "dc_read_types","dc_read_fields","dc_read","dc_find","dc_select",
      "check_variable","get_variable_value","get_variable_id","get_variable_orig",
      "set_variable_value_if_undefined","component","lock","unlock","storage_put","storage_get","storage_del",
      "var","wsurl","site","domain","parentdomain","isworktime",
      "e","pi","phi","tab","endline","quot","dblquot",
      "ivrparam","callednum","calledext","remotenum","callerid","calledid","callid","seanceid","seancenativeid","sipheader","huntid","huntobjid",
      "queuepriority","queueposition","queueestimatedsec","queuerescount","queuestate",
      "q_displayname","q_username","q_domain","r_number"
    ]
  }
}