Dialer's outbound campaign

To create the new outbound campaign you need to send the POST request to Webitel Engine server address with set request body. See the example of such request below:

POST /api/v2/dialer

Content-Type: application/json
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg


request body

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

{
    "name" : "myPredictiveDialer",
    "description" : "test dialer",
    "type" : "Predictive Dialer",
    "priority" : 1,
    "calendar" : {
        "id" : "594225b53c1956000b41db7b",
        "name" : "WorksDay"
    },
    "parameters" : {
        "limit" : 20,
        "minBillSec" : 10,
        "originateTimeout" : 40,
        "maxTryCount" : 0,
        "intervalTryCount" : 180,
        "wrapUpTime" : 60,
        "predictAdjust" : 150,
        "targetPredictiveSilentCalls" : 2.5,
        "maxPredictiveSilentCalls" : 3,
        "waitingForResultStatus" : true,
        "recordSession" : true,
        "eternalQueue" : true,
        "retryAbandoned" : false,
        "retriesByNumber" : true,
        "oneDayTask" : false
    },
    "amd" : {
        "enabled" : true,
        "allowNotSure" : true,
        "maximumWordLength" : 5000,
        "maximumNumberOfWords" : 3,
        "betweenWordsSilence" : 50,
        "minWordLength" : 100,
        "totalAnalysisTime" : 5000,
        "silenceThreshold" : 256,
        "afterGreetingSilence" : 800,
        "greeting" : 1500,
        "initialSilence" : 2500
    },
    "variables" : {
        "myVar" : "10"
    },
    "numberStrategy" : "by-priority",
    "membersStrategy" : "next-tries-circuit",
    "autoResetStats" : true,
    "resources" : [
        {
            "dialedNumber" : "^\\+?60(\\d{8,11})$",
            "destinations" : [
                {
                    "gwName" : "testDialer",
                    "dialString" : "0$1",
                    "gwProto" : "sip",
                    "order" : 0,
                    "limit" : 10,
                    "enabled" : true,
                    "callerIdNumber" : "000000000"
                }
            ]
        }
    ],
    "agentParams" : {
        "callTimeout" : 20,
        "wrapUpTime" : 40,
        "maxNoAnswer" : 2,
        "busyDelayTime" : 10,
        "rejectDelayTime" : 10,
        "noAnswerDelayTime" : 10
    },
    "agents" : [
        "100",
        "200"
    ],
    "skills" : [
        "english"
    ],
    "agentStrategy" : "longest_idle_agent",
    "communications" : {
        "types" : [
            {
                "name" : "Personal",
                "code" : "1",
                "ranges" : [
                    {
                        "startTime" : 540,
                        "endTime" : 1080,
                        "attempts" : 2,
                        "priority" : 10
                    }
                ]
            },
            {
                "name" : "Home",
                "code" : "2",
                "ranges" : [
                    {
                        "startTime" : 1080,
                        "endTime" : 1260,
                        "attempts" : 1,
                        "priority" : 5
                    }
                ]
            }
        ]
    }
}

A description of the structure of the request body is given in the table below:

#NameTypeDescription
2namestringCampaign's name
3descriptionstringCustom campaign description
4typestring

Dialer type. It can take one of the values:

  • Predictive Dialer
  • Progressive Dialer
  • Voice Broadcasting
5prioritynumberCampaign priority (any integer). Default number is 0.
6calendarobjectWork calendar. You must specify the identifier and name of the previously created calendar.
10parametersobjectAdditional campaign parameters: 11 - 25.
11limitnumberThe maximum number of simultaneous calls.
12minBillSecnumberThe minimum duration of a successful call is "in conversation" if the call result function is not enabled (20).
13originateTimeoutnumberThe maximum duration of a subscriber call.
14maxTryCountnumberThe maximum number of attempts to dial a subscriber.
15intervalTryCountnumberWaiting between dialing attempts in seconds.
16wrapUpTimenumberDuration of waiting for a call result if the call result function is enabled (20).
17predictAdjustnumberThe number of completed attempts, after which the Predictive mechanisms for the Predictive Dialer are turned on.
18targetPredictiveSilentCallsnumberTarget lost call rate for the Predictive Dialer.
19maxPredictiveSilentCallsnumberThe maximum allowable rate of lost calls for the Predictive Dialer.
20waitingForResultStatusbooleanCall Result - the expected result of dialing a subscriber from an external system through the REST API.
21recordSessionbooleanEnable conversation recording.
22eternalQueueboolean"Eternal Campaign" - do not stop after all subscribers have dialed.
23retryAbandonedbooleanContinue attempts to dial the subscriber after he has been "lost".
24retriesByNumberbooleanThe number of attempts for the type of number to count for each number of this type separately.
25oneDayTaskbooleanOne day campaign. Do not transfer subscribers to the next day if all attempts are made to dial within one day (0:00 - 24:00).
27amdobjectFunction of answering machine detection: 28 - 38.
28enabledbooleanEnable autoresponder detection.
29allowNotSurebooleanTransfer calls to the operator in which unambiguous recognition of the person is not received.
30maximumWordLengthnumberMaximum duration of one sentence (ms).
31maximumNumberOfWordsnumberThe maximum number of words in the greeting. If it is exceeded - an answering machine.
32betweenWordsSilencenumberDuration of silence between words (ms).
33minWordLengthnumberThe minimum duration of a continuous voice sound to define this sound as a word (ms).
34totalAnalysisTimenumberThe maximum time set for the operation of the algorithm for identifying a person or answering machine (ms).
35silenceThresholdnumberThe maximum duration of silence between words (ms).
36afterGreetingSilencenumberSilence after greeting (ms).
37greetingnumberMaximum greeting length (ms).
38initialSilencenumber

Maximum silence before greeting (ms).

40variablesobjectAdditional variables that will be assigned to the channel of each dial-up attempt for all campaign subscribers.
43numberStrategystring

Number selection strategy by type of subscriber communication facility. One of the values is possible:

  • by-priority - we make a given number of attempts, first, according to the highest priority type of communication tool, then move on to the next type.
  • top-down - one attempt is sequentially performed for each type of communication medium.
44membersStrategystring

The strategy of passing the list of subscribers. One of the values is possible:

  • next-tries-circuit - at the beginning, select subscribers who have a higher priority and were previously added taking into account the time of the next dial-up attempt.
  • strict-circuit - at the beginning, select subscribers who have a higher priority and were previously added. The time of the next dial-up attempt should be taken into account only after the complete passage of the entire list of subscribers.
45autoResetStatsbooleanAutomatically clear statistics and performance indicators of campaign operators at 0:00.
46resourcesarrayAn array of objects with outbound callflow (47 - 62).
48dialedNumberstringRegular expression of the subscriber's phone number.
49destinationsarrayArray of objects (50 - 59), with a description of the directions of the output of the call.
51gwNamestringGateway name from 07 Gateways.
52dialStringstringDial number string.
54ordernumberOrder (sequence) of choice.
55limitnumberThe number of simultaneous calls in this direction.
56enabledbooleanenabled or not
57callerIdNumberstringCallerID for destination.
62agentParamsobjectGeneral parameters of operators in the campaign (63 - 68). If not set, then the individual settings of each of the operators in the 06 Directory are taken into account.
63callTimeoutnumberThe maximum duration of a call to the operator (dial-up to the operator).
64wrapUpTimenumberThe time for completing the call. At this time, the dialer does not distribute the call to the agent.
65maxNoAnswernumberThe maximum number of consecutive calls without an operator answering, after which the system will take the operator to a break.
66busyDelayTimenumberThe delay in seconds between calls from the queue if the agent is busy.
67rejectDelayTimenumberThe delay in seconds between calls from the queue if the agent rejects the call.
68noAnswerDelayTimenumberThe delay in seconds between calls from the queue if the agent did not answer.
70agentsarrayAn array with the numbers of operators assigned to this campaign.
74skillsarrayAn array with operator skills that will be automatically included in this campaign.
77agentStrategystring

The strategy of choosing a free operator. One of the values is possible:

  • random - in random order.

  • agent-with-fewest-calls - first to the operator with the least number of calls.

  • agent-with-least-talk-time- first to the operator with the least time in the conversation.

  • longest-idle-agent- first to the operator with the longest waiting time.

78communicationsobjectCommunication facilities of subscribers.
79typesarrayAn array with types of communication tools of subscribers (80 - 104).
81namestringThe name of the type of communications.
82codestringCommunication type code.
83rangesarrayAn array of objects describing time and quantity parameters for each type of communication tool.
85startTimenumberThe start time of the action.
86endTimenumberAction completion time.
87attemptsnumberThe number of attempts to dial.
88prioritynumberPriority.

After successfully creating a new campaign, the server returns the identifier in the response:

Respons

1
2
3
4
5
6
7
8
9
10
11
12
13
14

{
    "status": "OK",
    "data": {
        "result": {
            "ok": 1,
            "n": 1
        },
        "ops": [],
        "insertedCount": 1,
        "insertedIds": [
            "5947d253877320000ca427a7"
        ]
    }
}

To change the campaign parameters, you must send PUT with the updated request body. For example:

PUT /api/v2/dialer/5947d253877320000ca427a7

Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg

To delete a campaign, a DELETE request is used, and to get information on a dealer, GET


To start the campaign you need to send a PUT request without a body

PUT /api/v2/dialer/5947d253877320000ca427a7/state/1

Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg


Subscribers upload:

To add a new subscriber to the created campaign, you need to send a POST request to the Webitel Engine server address with the specified request body. The following is an example of such a request:


POST /api/v2/dialer/5947d253877320000ca427a7/members?autoRun=true

Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg

Body

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

{
    "name": "Ivan Ivanov",
    "priority": 10,
    "variables": {
        "productId": "235444"
    },
    "communications": [
        {
            "number": "380911234567",
            "priority": 5,
            "type": "1",
            "description": "new"
        },
        {
            "number": "380921234567",
            "priority": 1,
            "description": "old one, without communication type"
        }
    ],
    "expire": 1497992400000
}


autoRun

The parameter allows you to automatically launch a campaign after adding a subscriber.

Body JSON

Variable

Type

Description

namestringCustom subscriber name
prioritynumberCall Priority (any integer). Default number is 0.

communications

array

An array of phone numbers with priorities for dialing one subscriber if you need to specify more than one means of communication for search. The type field indicates the code type of the communication medium.

variablesobject

Additional variables that will be assigned to the channel of each attempt to dial the subscriber.

expirenumberOptional parameter. Indicates the maximum time to which the subscriber should ring. If this subscriber is not served within the indicated time period, the dialer will stop making calls.

After successfully adding a subscriber, the server returns an identifier in the response:

Answer example

{
    "status": "OK",
    "data": {
        "result": {
            "ok": 1,
            "n": 1
        },
        "ops": [],
        "insertedCount": 1,
        "insertedIds": [
            "5949067198ff9f000ca9a264"
        ]
    }
}

To change the PUT data, to delete a subscriber, a DELETE request is used, and to get information - GET

GET /api/v2/dialer/5947d253877320000ca427a7/members/5949067198ff9f000ca9a264

X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg


Call Result Management

If the function to manage the result of a call from an external application, waitingForResultStatus, has been activated, at the end of each successful call, the dialer will wait for a REST request with the status - consider this attempt successful or not. Also, it is possible to transfer a new phone, exclude the current one or set a new dial-up time. Request example:

PUT /api/v2/dialer/5947d253877320000ca427a7/members/5949067198ff9f000ca9a264/status

Content-Type: application/json
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg


Body

{
    "success": false,
    "reset_retries": false,
    "next_after_sec": 3600,
    "next_communication": "380910000000",
    "stop_communications": ["380920000000", "380930000000"],
    "description": "Перезвонить через час на другой номер"
}


Body JSON


Variable

Type

Description

success
boolean
  • true - Successful call. Stop calling the subscriber to all other numbers.
  • false - Not a successful call. Continue dialing attempts.
reset_retries
booleantrue - Completely clear all attempts by all means of communication of the subscriber and start from the beginning.
next_after_sec
numberIf indicated, the time in seconds after how much to make the next attempt to dial the subscriber. If time is not specified, the value from the settings of the dealer is taken into account.
next_communication
stringTo which number to make the next attempt. If no number is specified, the number will be selected in priority order. If a new number is specified, it will be added with a higher priority.
stop_communications
array

An array with numbers that you can’t dial into anymore. Or, you can specify all (as a string), then dialing to all numbers except for the one specified in the next_communication field will be stopped

"stop_communications": "all"
description
string

Random comment on action.

Cancel call member

To cancel (without deleting) a call member, you can send a terminate PUT request:

PUT /api/v2/dialer/5947d253877320000ca427a7/members/5949067198ff9f000ca9a264/terminate

X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg
  • No labels