Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Операторы
if
Оператор if управляет условным ветвлением.
Code Block |
---|
{
"if": {
"expression": "${myVar} == '1'",
"then": [],
"else": []
}
} |
switch
Операторы switch и case помогают управлять сложными условными операциями и операциями ветвления.
Code Block |
---|
{
"switch": {
"variable": "${getIvrDigit}",
"case": {
"1": [],
"2": [],
"3": [],
"default": []
}
}
} |
Триггеры
disconnected
Выполняет набор приложений после завершение выполнения скрипта. Объявляется единожды вначале скрипта.
Code Block |
---|
{
"trigger": {
"disconnected": []
}
} |
Функции
function
Объединить набор приложений в именную функцию. Объявляется вначале скрипта.
Code Block |
---|
{
"function": {
"name": "myFunction",
"actions": []
}
} |
execute
Выполнение предварительно объявленной функции по имени.
Code Block |
---|
{
"execute": {
"name": "myFunction"
}
} |
Переменные
set
Назначение переменных на канал.
Code Block |
---|
{
"set": {
"hangup_after_bridge": "true",
"ivrLang": "en"
}
} |
export
Экспорт переменных на сторону оператора, а так же, в статистику.
Code Block |
---|
{
"export": [
"reverted_caller_id_number"
]
}, |
unSet
Разустанавливает переменную.
Code Block |
---|
{
"unSet": [
"reverted_caller_id_number"
]
} |
Служебные приложения
calendar
Приложение позволяет проверить текущее время с рабочем календарем. Значение сохраняется в переменную.
Code Block |
---|
{
"calendar": {
"extended": false,
"name": "WorkDay",
"setVar": "isWorkDay"
}
} |
httpRequest
Выполнение HTTP REST запроса и обработка результата (get JSON)
Code Block |
---|
{
"httpRequest": {
"url": "https://sales.bpmonline.com/${id}/dataservice/json/reply/SelectQuery",
"method": "POST",
"timeout": 1000,
"responseCode": "http_response_code",
"headers": {
"Content-Type":"application/json",
"Cookie": "${my_cookie}"
},
"path": {
"id": 0
},
"data": {
"Name": "Supervisor",
"UserID": "Supervisor"
},
"exportVariables": {
"effective_caller_id_name": "callerIdName",
"owner_caller_id_number": "callerIdOwner"
}
}
} |
js
Выполнение произвольного JavaScript кода с возвращением результата в переменную
Code Block |
---|
{
"js": {
"data": "var time = LocalDate(); time.setDate(time.getDate() + (+${dpd}*-1)); return time.getMonth() + '-' + time.getDate() + '-' + time.getFullYear()",
"setVar": "myVar"
}
} |
math
Приложение для работы с математическими функциями
Code Block |
---|
{
"math": {
"data": "${caller_id_array}",
"setVar": "new_random_caller_id",
"fn": "random"
}
} |
fn
random
: returns a random number from arraymin
andmax
: can be used to find the lowest or highest value in a list of argumentsround
: rounds a number to the nearest integerceil
: rounds a number up to the nearest integerfloor
: rounds a number down to the nearest integer
string
Приложение для работы со строкой.
Code Block |
---|
{
"string": {
"data": "${caller_id_number}",
"fn": "reverse",
"setVar": "reverted_caller_id_number"
}
} |
fn
length
: returns the length of a stringindexOf
andlastIndexOf
: returns the index of (the position of) the first or last occurrence of a specified text in a stringsearch
: searches a string for a specified value and returns the position of the matchslice
: extracts a part of a string and returns the extracted part in a new stringsubstring
: is similar to slice. The difference is thatsubstring
cannot accept negative indexes.substr
: is similar to slice. The difference is that the second parameter specifies the length of the extracted part.replace
: replaces a specified value with another value in a stringtoUpperCase
ortoLowerCase
: A string is converted to upper case or to lower casecharAt
: returns the character at a specified index (position) in a stringcharCodeAt
: returns the unicode of the character at a specified index in a stringsplit
: A string can be converted to an array with thesplit
functionreverse
: Reverse the provided stringbase64
: base64 encoder / decoderMD5
: Computes a digest from a string usingMD5
algorithmSHA-256
: Computes a digest from a string usingSHA-256
algorithmSHA-512
: Computes a digest from a string usingSHA-512
algorithm
schema
Выполнить внешнюю схему по идентификатору
Code Block |
---|
{
"schema": {
"id": 1
}
} |
setGrantee
Передать права на канал пользователю с идентификатором указанным в id
Code Block |
---|
{
"setGrantee": {
"id": 10
}
} |
sleep
Пауза выполнения скрипта в миллисекундах
Code Block |
---|
{
"sleep": 1000
} |
log
Вывод дополнительной информации в лог файл приложений
Code Block |
---|
{
"log": " >> ${Hold} <<<"
} |
Параметры приложений
Данные приложения могут вызываться как самостоятельно, так и как параметр другого приложения.
tag
Установить именную метку в скрипте
Code Block |
---|
{
"tag": "tagName"
} |
goto
Перейти к именной метке
Code Block |
---|
{
"goto": "tagName"
} |
async
Выполнение приложения без блокировки
Code Block |
---|
{
"async": true
} |
break
Прерывает выполнение скрипта
Code Block |
---|
{
"break": true
} |
limit
Позволяет прерывать цикл после прохождения количества указанного в атрибуте max. Выход осуществляется в именную метку указанною в атрибуте failover.
Code Block |
---|
{
"limit": {
"max": 5,
"failover": "anotherTag"
}
} |
Общие приложения
Table of Contents | ||
---|---|---|
|