Ограничения сценариев

Путь расположения

Путь в сборочном каталоге

/era_env/priv/metadata/<SOLUTION>/scripts.json

Обзор

Ограничивает функциональность сценариев в домене.

Устанавливает:

  • доступный набор типов сценариев и для каждого из них доступный набор типов компонентов.

  • доступный набор функций расчетчика выражений.

  • для определенных типов компонентов может модифицировать атрибуты полей. Например, устанавливать значение по умолчанию, и скрывать из видимости.

Доступно также для мастер-домена (предопределенный солюшен master).

Формат:
{
  "components": {
    "loaded": {
      "ivr": [100, 101, ...],
      "svc": [100, 101, ...],
 	  ...
    },
    "fields": {
      "101": {
        "<FIELDNAME>": {
          "default":VALUE,
          "visible":BOOL
        },
        ...
      },
      ...
    }
  },
  "expressions": {
    "functions": ["sin", "cos", ...]
  }
}
  • components – раздел структуры компонентов.

    • loaded – определяет доступные типы сценариев и состав компонентов для каждого из них. Доступные типы: ivr, svc.

    • fields – переопределяет видимость полей и дефолтные значения для конкретных компонентов.

  • expressions – раздел доступа для расчетчика выражений.

    • functions – определяет доступ сценариев к предопределенным функциям.

Пример

Устанавливает доступными для доменов солюшена типов сценариев ivr и svc. Каждому из них открывает доступ к перечисленным компонентам. Для компонента старт (101) переопределяет некоторые свойства: скрывает поле startParam, устанавливает значение по умолчанию для поля type. Открывает доступ сценариям домена к перечисленным функциям выражений, скрывая доступ к остальным.

Пример:
{
  "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"
    ]
  }
}