...
Code Block | ||||
---|---|---|---|---|
| ||||
[
{
"ringback": {
"call": {
"name": "$${ru-ring}",
"type": "tone"
},
"transfer": {
"name": "$${ru-ring}",
"type": "tone"
}
}
},
{
"httpRequest": {
"exportCookie": "my_cookie",
"url": "https://example.bpmonline.com/ServiceModel/AuthService.svc/Login",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"data": {
"UserName": "Supervisor",
"UserPassword": "Supervisor"
}
}
},
{
"string": {
"fn": "reverse",
"data": "${caller_id_number}",
"setVar": "reverted_caller_id_number"
}
},
{
"string": {
"data": "${my_cookie}",
"fn": "replace",
"setVar": "BPMCSRF",
"args": [
"/.*BPMCSRF=([\\s\\S]*?);(.*)?/",
"$1"
]
}
},
{
"httpRequest": {
"url": "https://example.bpmonline.com/0/dataservice/json/reply/SelectQuery",
"method": "POST",
"headers": {
"Cookie": "${my_cookie}",
"BPMCSRF": "${BPMCSRF}",
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json"
},
"exportVariables": {
"Contact": "rows.0.Name",
"owner_caller_id_number": "rows.0.OwnerLogin"
},
"data": {
"QueryType": 0,
"Columns": {
"Items": {
"Name": {
"OrderDirection": 0,
"OrderPosition": 0,
"Caption": null,
"Expression": {
"ExpressionType": 0,
"ColumnPath": "Name"
}
},
"OwnerLogin": {
"OrderDirection": 0,
"OrderPosition": 0,
"Caption": null,
"Expression": {
"ExpressionType": 0,
"ColumnPath": "[WSysAccount:Contact:Owner].Login"
}
}
}
},
"AllColumns": false,
"IsDistinct": false,
"RowCount": 1,
"Filters": {
"FilterType": 6,
"ComparisonType": 0,
"LogicalOperation": 0,
"IsNull": true,
"IsEnabled": true,
"IsNot": false,
"Items": {
"FilterByPhone": {
"FilterType": 1,
"ComparisonType": 9,
"LogicalOperation": 0,
"IsNull": true,
"IsEnabled": true,
"IsNot": false,
"LeftExpression": {
"ExpressionType": 0,
"ColumnPath": "[ContactCommunication:Contact].SearchNumber"
},
"RightExpression": {
"ExpressionType": 2,
"ColumnPath": null,
"Parameter": {
"DataValueType": 1,
"Value": "${reverted_caller_id_number}"
}
}
}
}
},
"RootSchemaName": "Contact",
"OperationType": 0
}
}
},
{
"setVar": [
"continue_on_fail=true",
"hangup_after_bridge=true",
"ignore_early_media=true"
]
},
{
"answer": "183"
},
{
"if": {
"expression": "${owner_caller_id_number}",
"then": [
{
"bridge": {
"endpoints": [
{
"name": "${owner_caller_id_number}",
"type": "user",
"parameters": [
"leg_timeout=10"
]
}
]
}
}
]
}
},
{
"bridge": {
"endpoints": [
{
"name": "100",
"type": "user"
}
]
}
}
] |
...