Real Time API

You can use the Real Time API to get events of calls and call status changes as well as user status changes in your organization.
By implementing The Real Time API in your system you can create pop-up screen, real-time dashboard and many more functionalities where you will be able to utilize your business logic along with you telephony activity.
real time api feature work illustration

General Explanation

 

Voicenter RealTime API uses events (in JSON format) to showcase the telephony activity of your account.
The events are sent via socket communication with Voicenter APIs and backbends.

You can use these event to create a popup or in case you are not using chrome browser the Real Time API will allow you to receive calling client's phone number in incoming calls.

This API suit for single page applications and using this API will allow you to do many other automated processes within your organization. 

The Events SDK is used to communicate with Voicenter servers in order to receive real-
time data via sockets.
Underneath, the events SDK uses socket.io to send and receive events.

You can access our Voicenter Real time Events SDK library by pressing here or NuGet library for VoicenterEventsSDK.NET here.

 

Login type

 

To use the Realtime API, your organization will need to login to the service.
There are two types of connections to the service - User/Account.

 

User loginType

 

User - If you wish to receive events per user, you can use the credentials of each users
that can be obtained via Voicenter Cpanel interface.

 

User login Type example

 

1
2
3
4
5
          
let sdk = new EventsSDK({
loginType: 'user',
email: '[email protected]',
password: 'password',
});
        

 

Account Login Type

 

If you wish to receive events of your entire account, you can use your account credentials or account token (provided by Voicenter).

 

Account login Type example

 

1
2
3
4
5
          
let sdk = new EventsSDK({
loginType: 'account',
username: 'username',
password: 'password',
});
        

 

Account token loginType example

1
2
3
4
5
          
let sdk = new EventsSDK({
loginType: 'token',
useLoginApi: true,
token: 'token',
});
        

 

HTML (WebSocket) connection example – Client Side

 

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
          
<html>
<head></head>
<body>
Status: <span id="status-txt">Disconnected</span>
<br/>
<br/>
<div id="response-body"></div>
</body>
</html>
<!-- Events SDK -->

<script src="https://cdn.voicenter.co/cdn/events-sdk/voicenter-events-sdk.umd.js"></script>

<script>
let sdk = new EventsSDK({
loginType: 'user',
email: '[email protected]',
password: 'password',
});
sdk.init().then(function () {
// Success login event
sdk.on('loginSuccess', function (response) {
document.getElementById("status-txt").innerHTML = "Connected";
})
// Extension event
sdk.on('ExtensionEvent', function (response) {
console.log(response);
const cur = document.getElementById("response-body");
cur.innerHTML = cur.innerHTML + response.data.reason + "<br />";
})
// After logging in, receive all extensions statuses
sdk.on('AllExtensionsStatus', function (response) {
console.log(response);
})
});
</script>
        

 

HTML sample project output example.
First glance of the initial page will reveal connection status and ongoing events of the user/account.

In order to view details of events, please go to your browser’s diagnostic tools. (Normally done by pressing the F12 key).

 

 

C# (WebSocket) connection example – Server Side

 

You can learn more from our demo GitHub repository.

 

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
          
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VoicenterRealtimeAPI;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
//Logger
VoicenterRealtime voicenterRealtime = new VoicenterRealtime();
Logger.onLog += (object sender, VoicenterRealtimeLogger e) =>
{
Console.WriteLine(e.message);
};
//Listener
VoicenterRealtimeListener socket = voicenterRealtime.Token("XXXXX").Init();
socket.OnEvent += OnEventHandler;
socket.Listen();
Console.ReadLine();
}
}
}
        

 

This will the response after the connection:

 

 

RealTime API – Events Types

 

The Voicenter web socket server has the following types of events sent to your client in real
time.

While connected with the appropriate web socket containing the right permissions.

The data is sent in POST JSON format.

 

  1. Initial message
  2. loginSuccess
  3. loginStatus
  4. AllExtensionStatus
  5. QueueEvents
  6. ExtensionEvent

 

Initial message

 

This type of event will be sent in the initial login connection request.

The sent data in this event describes the initial socket settings.

Mainly for Voicenter use.

Field Name Description Type
sidSocket id - a unique code referring to this specific connection of socket that was established.String
UpgradesThe list of possible transport upgrades.Array
pingIntervalThe Interval the of socket.io protocol.Integer
pingTimeoutThe timeout Interval of the socket.io protocol.Integer

 

Initial message Response

 

1
2
3
4
5
6
          
{
sid: "WF-eNmG0VbGkSn1wbD3n",
upgrades: [],
pingInterval: 60000,
pingTimeout: 180000
}
        

 

loginSuccess

 

This type of event will be sent in the initial login connection request in case of a successful connection only.
In case of wrong user name or password or token, you will receive a 401 (“Unauthorized”) or 500 (“Unexpected token”) http error.

 

loginSuccess parameters

 

Field Name Description Type
errorCode0 - Connection was establishing successfully.Integer
errorDesc“Ok” - Connection was establishing successfully.String
servertimeThe Interval the of socket.io protocol.Integer
servertimeoffsetThe timeout Interval of the socket.io protocol.Integer

 

loginSuccess parameters Example

 

1
2
3
4
5
6
          
{
errorCode: 0,
errorDesc: "OK"
servertime: 1597930812,
servertimeoffset: 180,
}
        

 

loginStatus

 

This type of event will be sent only in case of a successful connection.
The event describes the list of monitored queues on this active connection.
The list of monitored queues will only be sent if the login connection was made with account credentials or account token.
If the login connection type is by user credentials, only the user’s extension assigned queues will return.

 

loginStatus Parameters

 

Field Name Description Type
errorCode0 – ok. no errors.Integer
errorDesc“Ok” - Connection was establishing successfully.String
servertimeThe Interval the of socket.io protocol.Integer
servertimeoffsetThe timeout Interval of the socket.io protocol.Integer
QueuesA list of the monitored queues.Array
QueueIDVoicenter queue ID.Integer
QueueNameVoicenter queue name.String
CallsA list of the current waiting calls in a specific queue.
If there are no waiting calls in the specific queue the array will be empty.
Array
CallerIDThe caller caller ID.String
CallerNameThe caller caller name.
In Voicenter calls you can show a string value for a call.
Not supported by all providers
String
IvrUniqueIDThe call unique Voicenter ID.String
IvridThe call unique Voicenter ID (same as the field described above).String
JoinTimeStampWhen the call was entered to the queue (epoch).Integer

 

loginStatus Example

 

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
          
["loginStatus",
{
"servertime":1597941727,
"queues":[
{
"Calls":[
{
"CallerID":"0501234567",
"CallerName":"John Doe",
"IvrUniqueID":"2020082015645675456434324949c071d",
"JoinTimeStamp":1597941709,

"ivrid":"2020082015645675456434324949c071d"
}
],
"QueueID":12345678,
"QueueName":"Queue1"
},
{
"Calls":[],
"QueueID":12345679,
"QueueName":"Queue2"
}
],
"errorCode":0
}
]
        

 

AllExtensionStatus

 

This type of event will be sent in case of a successful connection only.
The event describes the list of active monitored extensions on this active connection.
The list of monitored extensions will only be sent if the login connection was made with
account credentials or account token.
If the login connection type is by user credentials, the extensions list returns the current logged in user’s extension.

 

AllExtensionStatus Table

 

Field name Description Type
errorCode0 – ok. no errors.Integer
errorDesc“Ok” - Connection was establishing successfully.String
servertimeThe Interval the of socket.io protocol.Integer
servertimeoffsetThe timeout Interval of the socket.io protocol.Integer
extensionsA list of the monitored extensions.Array
userIDVoicenter user ID.
The user that the extensions is assigned to.
Each extension is assigned to a user.
Integer
onlineUserIDThe user ID of the user that is currently logged on to the extension.
In case the representatives in your organization login in each shift to a different extension, this field will show the name of the representative that is currently working at the extension.
Integer
userNameVoicenter user name.
The user that the extensions is assigned to.
String
numberVoicenter extension ID.Integer
extenUserSip username of the extension.String
representativeThe user ID of the user that is currently logged on to the extension.
In case the representatives in the organization login in each shift to a different extension, this field will show the name of the representative that is currently working at the extension.
Integer
summeryIn this array, we sent the name of the representative that is working with the extension.
In case no representative made a login action to the extension, the name of the user that the extension is assigned to will be sent.
Only the field which is sent in this array is “representative” with a String value.
Array
representativeStatusThe current login status ID of the connected user.
A value between 1-13 indicating the online user status.
Integer
representativeUpdatedThe time of the last user status change.Integer
lastCallEventEpochWhen was the last time a call was made in the extension, Epoch time.Integer
lastAnsweredCallEventEpochWhen was the last time a call was answered in the extension, Epoch time.Integer
lastHangupCallEpochWhen was the last time a call was ended in the extension, Epoch time.Integer
CallsA list of the current active calls in the extension.
If there are no dialing\ringing calls in the specific extension the list will be empty.
Array
CallerIDThe caller caller ID.String
CallerNameThe caller caller name.
In Voicenter calls you can show a string value for a call.
Not supported by all providers.
String
IvrUniqueIDThe call unique Voicenter ID.String
IvridThe call unique Voicenter ID (same as the field described above).String
JoinTimeStampWhen the call was entered to the queue (epoch).Integer

 

AllExtensionStatus Example

 

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
          
["AllExtensionsStatus",
{
"servertime":1597945606,
"extensions":
[
{
"calls":[],
"userID":12345678,
"userName":"Clark Kent",
"number":9876543,
"onlineUserID":12345678,
"extenUser":"SIPSIP1",
"summery":
{
"representative":"Clark Kent"
},
"representative":0,
"representativeStatus":2,
"lastCallEventEpoch":1597933035,
"lastAnsweredCallEventEpoch":1545243466,
"representativeUpdated":0,
"peerStatus":"OK"
},
{
"calls":[],
"userID":12345679,
"userName":"Lois Lane",
"number":9876542,
"extenUser":"SIPSIP2",
"summery":
{
"representative":"Lois Lane"
},
"representative":12345679,
"representativeStatus":1,
"lastCallEventEpoch":1597944981,
"lastAnsweredCallEventEpoch":1597944981,
"representativeUpdated":1597944933000,
"peerStatus":"OK"
}
],
"errorCode":0
}
]
        

 

QueueEvent

 

This type of event describes call entering and exiting a queue.
It will only be sent if the initial socket login connection was made with account credentials or account token.
If the login connection type is by user credentials, this type of event will not be sent.

 

QueueEvent Parameters

 

Field name Description Type
eventName"queue". Indication of the event type.String
reasonThe reason this event was sent. For queue event there can be these reasons:
“JOIN” – A new call was entered to the queue and it is now waiting to be answered.
“EXIT” – When a waiting call is answered in one of the extensions.
“ABANDONED” - When a waiting call is not answered.
Either the caller chose to end the call or the call waiting time in the queue had reached the maximum waiting time.
String
servertimeThe Interval the of socket.io protocol.Integer
servertimeoffsetThe timeout Interval of the socket.io protocol.Integer
dataA list of the queue event details.Array
QueueIDVoicenter queue ID.Integer
QueueNameVoicenter queue name.String
CallsA list of the current waiting calls in a specific queue.
If there are no waiting calls in the specific queue the list will be empty.
Array
CallerIDThe caller caller ID.String
CallerNameThe caller caller name.
In Voicenter calls you can show a string value for a call.
Not supported by all providers.
String
IvrUniqueIDThe call unique Voicenter ID.String
IvridThe call unique Voicenter ID (same as the field described above).String
JoinTimeStampWhen the call was entered to the queue (epoch).Integer

 

QueueEvent JOIN Example

 

A call is entering a queue

 

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
          
["QueueEvent",
{
"data":
{
"QueueID":1234567,
"Calls":
[
{
"CallerID":"0501234567",
"CallerName":"John Doe”,
"IvrUniqueID":"2020082015645675456434324949c071d",
"JoinTimeStamp":1598206105,
"calldurationinterval":1598206105,
"ivrid":"2020082015645675456434324949c071d"
}
],
"QueueName":"Queue1"
},
"eventName":"queue",
"reason":"JOIN",
"servertime":1598206105,
"servertimeoffset":180,
"telephonyservertime":1598206105,
"ivruniqueid":"2020082015645675456434324949c071d"
}
]
        

 

QueueEvent EXIT Example

 

A call is answered by an extension (a call is exiting the queue)

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
          
["QueueEvent",
{
"data":
{
"QueueID":1234567,
"Calls":[],
"QueueName":"Queue1"
},
"eventName":"queue",
"reason":"EXIT",
"servertime":1598206119,
"servertimeoffset":180,
"telephonyservertime":1598206119,
"ivruniqueid":"2020082015645675456434324949c071d"
}
]
        

 

QueueEvent ABANDONED Example

 

The caller chose to end the call before his call was answered

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
          
["QueueEvent",
{
"data":
{
"QueueID":1234567,
"Calls":[],
"QueueName":"Queue1"
},
"eventName":"queue",
"reason":"ABANDONED",
"servertime":1598206251,
"servertimeoffset":180,
"telephonyservertime":1598206251,
"ivruniqueid":"2020082015645675456434324949c0712"
}
]
        

 

ExtensionEvent

 

This type of event describes call status(dialing\talking\hung-up) in the account extensions.
If the initial socket login connection was made with user credentials, only the user assigning extension\s will receive events.
If the initial socket login connection was made with account credentials or account token, all the extensions events will be sent.

 

ExtensionEvent Parameters

 

Field name Description Type
eventName"extension".
Indication of the event type.
String
reasonThe reason this event was sent.
“NEWCALL” – A new call is ringing or dialing from an extension.
“ANSWER” – A call was answered at an extension.
“HOLD” – A call was placed on hold.
“UNHOLD” – A call is no longer on hold.
“HANGUP” – When a call was ended. It is not necessarily means that the call was answered.
“userStatusUpdate” – When the extension online user updated his\her user status(Login, Break, Logout, etc.)
String
causeThis field will only be sent if the event “reason”= “HANGUP” and will indicate the cause of the hangup
“Normal hangup” – If a call rang at an extension and the call was ended.
It is not necessarily means that the call was answered.
“Answered elsewhere” – If the call rang simultaneously at several extensions and was answered, an “HANGUP” event will send to the all other extensions who did not answered the call.
“Call Rejected” – In case a leg1 click2call call was not answered.
String
servertimeThe Interval the of socket.io protocol.Integer
servertimeoffsetThe timeout Interval of the socket.io protocol.Integer
DataA list of the extension event details.Array
CallsA list of the current active calls in the extension.
If there are no dialing\ringing calls in the specific extension the list will be empty.
Array
currentCallThe “currentCall” data indicate which call the current event relates to.
In case there is more than one call on the extension, this array will indicate for which specific call this event is sent.
For example, if the extension is talking at a particular moment with a caller and during that time another waiting call is entered.
For the new entered call, a new event will be send.
Array
answeredWhether the call was answered.
0 – Not answered.
1 – Answered.
Boolean
callAnsweredTime in Epoch. When the call was answered.
In call did not answered yet the sent value will be 0.
Integer
callStartedTime in Epoch. When the call was started.Integer
callernameWhat string value will appear at the extension.
In Voicenter you can set a text value that will appear in when the call in ringing\dialing.
This data will appear only in Voicenter extensions.
String
callerphoneThe caller or callee phone number.String
callstatusWhat is the current call status?
“Ringing”- In case of an incoming call,
“Dialing”- In case of an Outgoing call,
“Talking” – In case a call was answered at an extension,
"Spying" - In case an extension is listening to another extension in the organization.
String
customdataIn case custom variables were assigned to the call.Array
didThe phone number that the caller dialed to.
This field will only send value in incoming calls.
String
directionThe direction of the call:
“Incoming”,
“Outgoing”,
“Spy” – In case, an extension is listening to another extension in the organization.
“Click2call”.
String
c2cdirectionThis field will only be sent in case the call type consists of two parts (Leg1, Leg2).
Two values are sent:
1 - Leg1.
2 - Leg2.
Integer
ivridThe call unique identifier.String
recordingThe call recording data details.Array
FilenameThe name of the call recording file.
Will be sent if the call was supposed to be recorded.
In case of an outgoing call, the data will be sent if the call was answered(it will not be sent in “NEWCALL” type event).
String
IsMutedIndicate whether the call recording was muted.
With the Voicenter Mute API and softphone, representatives can pause the recording of the call and unpause it.
0 – The call was not muted.
1 – The call was muted.
String
extenUserThe current extension SIP code.String
userIDVoicenter user ID.
The user that the extensions is assigned to.
Each extension is assigned to a user.
Integer
onlineUserIDThe user ID of the user that is currently logged on to the extension.
In case the representatives in the organization login in each shift to a different extension, this field will show the name of the representative that is currently working at the extension.
Integer
userNameVoicenter user name.
The user that the extensions is assigned to.
String
numberVoicenter extension ID.Integer
extenUserThe SIP user name of the relevant extension.String
representativeThe user ID of the user that is currently logged on to the extension.
In case the representatives in the organization login in each shift to a different extension, this field will show the name of the representative that is currently working at the extension.
Integer
representativeStatusThe current login status ID of the connected user.
A value between 1-13 indicating the online user status.
Integer
representativeUpdatedThe time of the last user status change.Integer
lastCallEventEpochWhen was the last time a call was made in the extension in Epoch time.Integer
lastAnsweredCallEventEpochWhen was the last time a call was answered in the extension in Epoch time.Integer
lastHangupCallEpochWhen was the last time a call was ended in the extension in Epoch time.Integer
callerIDFor incoming calls, the caller caller ID.
For outgoing calls the destination caller ID.
This field will be send on “reason”= “HANGUP” calls.
String
IvruniqueidThe call unique identifier.
This field will be send on “reason”:“HANGUP” calls.
Same as the field – “ivrid”.
String
queueIDVoicenter queue ID.
This field will be sent only if the call was directed through Voicenter queue service.
Integer
campaignIDVoicenter campaign ID.
This field will be sent only if the call was made by Voicenter automatic dialer service.
Integer

 

ExtensionEvent Examples

 

ExtensionEvent - Incoming NEWCALL

 

An incoming call is ringing at an extension – reason: NEWCALL

 

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"NEWCALL",
"servertime":1606908124,
"servertimeoffset":120,
"calls":[
{
"callStarted":1606908123,
"calldurationinterval":1606908123,
"callAnswered":0,
"answered":0,
"callername":"Test Voicenter",
"callerphone":"0501234567",
"callstatus":"Ringing",
"customdata":{},
"direction":"Incoming",
"ivrid":"202012021122010135330b4f77",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"0722776772"
}
],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606908124,
"lastAnsweredCallEventEpoch":1606847063,
"lastHangupCallEpoch":1606905028,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606908123,
"calldurationinterval":1606908123,
"callAnswered":0,
"answered":0,
"callername":"Test Voicenter",
"callerphone":"0501234567",
"callstatus":"Ringing",
"customdata":{},
"direction":"Incoming",
"ivrid":"202012021122010135330b4f77",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"0722776772"
}

}
}
]
        

 

ExtensionEvent - Incoming ANSWER

 

An incoming call is answered at an extension – reason: ANSWER

 

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
          
["ExtensionEvent",
{
"data": {
"eventName": "extension",
"reason": "ANSWER",
"servertime": 1606908124,
"servertimeoffset": 120,
"calls": [{
"callStarted": 1606908123,
"calldurationinterval": 1606908123,
"callAnswered": 1606908134,
"answered": 1,
"callername": "Test Voicenter",
"callerphone": "0501234567",
"callstatus": "Talking",
"customdata": {},
"direction": "Incoming",
"ivrid": "202012021122010135330b4f77",
"recording": {
"Filename": "2020120-aws-0501234567-0722776772.mp3",
"IsMuted": 0
},
"did": "0722776772"
}],
"userID": 7654321,
"userName": "Clark Kent",
"number": 1234567,
"extenUser": "SIPSIP1",
"summery": {
"representative": "Clark Kent"
},
"onlineUserID": 7654321,
"representative": 7654321,
"representativeStatus": 1,
"lastCallEventEpoch": 1606908124,
"lastAnsweredCallEventEpoch": 1606847063,
"lastHangupCallEpoch": 1606905028,
"representativeUpdated": 1606763622000,
"currentCall": {
"callStarted": 1606908123,
"calldurationinterval": 1606908123,
"callAnswered": 1606908134,
"answered": 1,
"callername": "Test Voicenter",
"callerphone": "0501234567",
"callstatus": "Talking",
"customdata": {},
"direction": "Incoming",
"ivrid": "202012021122010135330b4f77",
"recording": {
"Filename": "2020120-aws-0501234567-0722776772.mp3",
"IsMuted": 0
},
"did": "0722776772"
}
}
}
]
        

 

ExtensionEvent - Incoming HANGUP

 

An incoming call was ended after it was answered – reason: HANGUP

 

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"HANGUP",
"cause": "Normal hangup",
"callerID": "0501234567",
"ivruniqueid": "202012021122010135330b4f77",
"servertime":1606908139,
"servertimeoffset":120,
"calls":[],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606908139,
"lastAnsweredCallEventEpoch":1606908139,
"lastHangupCallEpoch":1606908139,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606908123,
"calldurationinterval":1606908123,
"callAnswered":1606908134,
"answered":1,
"callername":"Test Voicenter",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Incoming",
"ivrid":"202012021122010135330b4f77",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"0722776772"
}

}
}
]
        

 

ExtensionEvent - Click2call call Leg1 NEWCALL

 

An outgoing Click2call call. Leg1 – reason: NEWCALL

 

 

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"NEWCALL",
"servertime":1606913080,
"servertimeoffset":120,
"calls":[
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":0,
"answered":0,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Dialing",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-SIPSIP1-972501234567.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"1"
}
],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606913081,
"lastAnsweredCallEventEpoch":1606908139,
"lastHangupCallEpoch":1606908139,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":0,
"answered":0,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Dialing",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"1"
}

}
}
]
        

 

ExtensionEvent - Click2call call Leg1 ANSWER

 

An outgoing Click2call call. Leg1 – reason: ANSWER

 

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"ANSWER",
"servertime":1606913082,
"servertimeoffset":120,
"calls":[
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":1606913082,
"answered":1,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-SIPSIP1-972501234567.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"1"
}
],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606913081,
"lastAnsweredCallEventEpoch":1606908139,
"lastHangupCallEpoch":1606908139,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":1606913082,
"answered":1,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"1"
}

}
}
]
        

 

ExtensionEvent - Click2call call Leg2 NEWCALL

 

An outgoing Click2call call. Leg2 – reason: NEWCALL

 

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"NEWCALL",
"servertime":1606913083,
"servertimeoffset":120,
"calls":[
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":0,
"answered":0,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-SIPSIP1-972501234567.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"2"
}
],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606913083,
"lastAnsweredCallEventEpoch":1606913082,
"lastHangupCallEpoch":1606908139,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":0,
"answered":0,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"2"
}

}
}
]
        

 

ExtensionEvent - Click2call call Leg2 ANSWER

 

An outgoing Click2call call. Leg2 – reason: ANSWER

 

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"ANSWER",
"servertime":1606913090,
"servertimeoffset":120,
"calls":[
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":1606913090,
"answered":1,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-SIPSIP1-972501234567.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"2"
}
],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606913083,
"lastAnsweredCallEventEpoch":1606913082,
"lastHangupCallEpoch":1606908139,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":1606913090,
"answered":1,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"2"
}

}
}
]
        

 

ExtensionEvent - Click2call call Leg2 HANGUP

 

An outgoing Click2call call. Leg2 – reason: HANGUP

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
          
["ExtensionEvent",
{"data":
{
"eventName":"extension",
"reason":"HANGUP",
"servertime":1606913094,
"servertimeoffset":120,
"callerID": "0501234567",
"ivruniqueid": "20201200013quvnhxku5v",
"cause": "Normal hangup",
"calls":[],
"userID":7654321,
"userName":"Clark Kent",
"number":1234567,
"extenUser":"SIPSIP1",
"summery":{
"representative":"Clark Kent"
},
"onlineUserID":7654321,
"representative":7654321,
"representativeStatus":1,
"lastCallEventEpoch":1606913083,
"lastAnsweredCallEventEpoch":1606913082,
"lastHangupCallEpoch":1606908139,
"representativeUpdated":1606763622000,
"currentCall":
{
"callStarted":1606913080,
"calldurationinterval":1606913080,
"callAnswered":1606913090,
"answered":1,
"callername":"0501234567",
"callerphone":"0501234567",
"callstatus":"Talking",
"customdata":{},
"direction":"Click2Call",
"ivrid":"20201200013quvnhxku5v",
"recording":
{
"Filename":"2020120-aws-0501234567-0722776772.mp3",
"IsMuted":0
},
"did":"",
"c2cdirection":"2"
}

}
}
]
        

 

A user status change – reason: userStatusUpdate

 

The representative change his\her online status to status “3” (Lunch).
The list of all available user statuses can be found in the Voicenter “Login\Logout” API documentation.

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
          
["ExtensionEvent",
{
"eventName": "extension",
"reason": "userStatusUpdate",
"servertime": 1606917164,
"servertimeoffset": 120,
"data":
{
"calls": [],
"userID": 7654321,
"userName": "Clark Kent",
"number": 1234567,
"extenUser": "SIPSIP1",
"summery": {
"representative": "Clark Kent"
},
"onlineUserID": 7654321,
"representative": 7654321,
"representativeStatus": 3,
"lastCallEventEpoch": 1606915860,
"lastAnsweredCallEventEpoch": 1606915833,
"lastHangupCallEpoch": 1606915860,
"representativeUpdated": 1606917164000
}
}
]