Tradesense Wba Status Date
Tradesense Wba Status Date
Tradesense Wba Status Date
The old CTD API remains supported but will not be maintained.
Introduction
This document gives an overview about the functionalities that can be implemented by any third
parties that wish to leverage TradeSense data in their bigger pipe of data that implements
WebSockets.
Technical description
Message format
The API uses JSON serialized objects.
Datetime format
Datetime information are formatted as UTC datetime string following the ISO 8601
representation.
Example: "2018-07-06T12:13:17Z"
Command message
This object always contains the following keys:
{
"command":"command type",
"command_ref":"command reference",
"args":{}
}
Response message
The server-side will respond to each command with a message indicating if the command is done
and if it was successful. It will contain a data key containing the data object.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{}
}
Notify message
Client-side is able to subscribe to different types of notification. When subscribed, server-side will
send a message every second with all last notifications not yet received by the client.
The notification object sent by the server always contains following keys:
{
"command":"notify",
"data":{
"..."
}
}
Error handling
If an error occurs, the server will send a response message with success set to false . The
error key contains an object with two keys: code and message .
{
"command":"response",
"command_ref":"command reference",
"success":false,
"error":{
"code":"code",
"status":"status",
"message":"message",
"reason":"message for user"
}
}
The client has made a bad request, which includes requests with
400 Bad Request malformed JSON, or invalid data values as well as requests in
which the URL contains incorrect values
The client had not sent previously used token. If client needs
498 Invalid Token
new session, please disconnect and connect with new token
In addition, a reason can be provided to help the user understand what went wrong.
If the configured time out interval for requests is reached (see settings section)
User Creation
You will need a valid token to connect your websocket implementation. This token is delivered by
creating a new user on Assure.
https://TradeSenseFQDN/assure/admin/user/new/
wss://TradeSenseFQDN/api
Authentication
Client Server
Connect
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "TOKEN",
}
}
OK
{
"command": "response",
"command_ref": "command ref",
"success": true,
"data" :
{
...
}
}
Client Server
Authentication via API token is mandatory. When the client-side code decides to open a
WebSocket, it contacts the server-side using a command auth with the token as argument :
{
"command":"auth",
"command_ref":"command reference",
"args":{
"token":"TOKEN"
}
}
If the client-side supplies valid authentication, the authentication phase will complete by the
server sending the response message:
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{}
}
Errors
This command may return error messages :
Re-authentication
To avoid having long connected client session, TradeSense has introduced a session refresh
mechanism. This means clients needs to reauthenticate their session after a specific time. This
session authentication time is configurable through TSS. The client shall be notified by server
before the expiry time to re-authenticate itself.
Configuration
The following two configurable settings has been introduced. It can be configured at TSS ->
Productivity tools clusters -> Select the Cluster -> Settings. After these configuration the assure
stack needs to be restarted.
Default
Name Settings Description value
(seconds)
For example,
application.global.wba.auth.timeout = 1800
application.global.wba.auth.gracetime = 60
Use Cases
Different re-authentication use cases are described below,
application.global.wba.auth.timeout = 0
or
application.global.wba.auth.gracetime = 0
Connect
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "TOKEN",
}
}
OK
{
"command": "response",
"command_ref": "command ref",
"success": true
}
Client Server
application.global.wba.auth.timeout = 60
application.global.wba.auth.gracetime = 30
Grace Time(60-30) = 30
The server will send re-auth notification at the start of the Auth Gracetime. If client re-
authenticates within grace period (30 seconds) after receiving server re-authentication
notification, client session is refreshed. Server will repeat this re-auth mechanism until
Client/Server websocket disconnects or error cases.
Client Server
Successful Authentication
re-auth notification
{
"command": "server notification",
"command_ref": "authentication expiry",
"message": "Your authentication token is about to expire, please re-authenticate"
}
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "TOKEN",
}
}
OK
{
"command": "response",
"command_ref": "command ref",
"success": true
}
re-auth notification
{
"command": "server notification",
"command_ref": "authentication expiry",
"message": "Your authentication token is about to expire, please re-authenticate"
}
Client Server
Case 3 : Client re-auths before Gracetime
If client tries to get re-authenticated before receiving server re-authentication notification with
same user token, server will sends "User already authenticated" error message to client.
Client Server
Successful Authentication
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "TOKEN",
}
}
{
"command": "response",
"command_ref": "command ref",
"success": false,
"error" :
{
"code": 500,
"status": "Server Error",
"message": "An error happened on our end, and it is not your fault.\n Please contact your TSS administrator to find out what may cause this issue",
"reason": "User already authenticated"
}
}
Client Server
application.global.wba.auth.timeout = 60
application.global.wba.auth.gracetime = 30
Grace Time(60-30) = 30
If client did not re-authenticate within grace period (30 seconds) after receiving server re-
authentication notification, server will send session timed out notification and client session will
be disconnected. Client needs to connect to websocket again and start the new Authentication
process.
Client Server
Successful Authentication
re-auth notification
{
"command": "server notification",
"command_ref": "authentication expiry",
"message": "Your authentication token is about to expire, please re-authenticate"
}
After auth.gracetime
{
"command": "server notification",
"command_ref": "Session expired",
"message": "Session is expired"
}
session disconnected
Connect
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "TOKEN",
}
}
OK
{
"command": "response",
"command_ref": "command ref",
"success": true
}
Client Server
Case 5 : Client re-authenticates with different token
If client tries to re-authenticate within grace period (30 seconds) with a different token after
receiving server re-authentication notification, server will sends invalid token message to client.
Client Server
Successful Authentication
re-auth notification
{
"command": "server notification",
"command_ref": "authentication expiry",
"message": "Your authentication token is about to expire, please re-authenticate"
}
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "DIFFERENT TOKEN",
}
}
Invalid token
{
"command": "response",
"command_ref": "command ref",
"success": false,
"error" :
{
"code": 498,
"status": " Invalid Token",
"message": "The client had not sent previously used token. If client needs new session, please disconnect and connect with new token"
}
}
Client Server
Case 6 : Settings Auth Gracetime is greater than Auth Timeout
application.global.wba.auth.timeout = 20
application.global.wba.auth.gracetime = 30
This is not an expected configuration. However server will try to handle this. In this scenario, the
server will send re-auth notification immediately after the client has authenticated the session
and waits for grace period (30 seconds) to complete, if client re-authenticates within grace period
(30 seconds), server will send again re-auth notification immediately after re-authentication and
the process repeats.
Client Server
Successful Authentication
re-auth notification
{
"command": "server notification",
"command_ref": "authentication expiry",
"message": "Your authentication token is about to expire, please re-authenticate"
}
Auth
{
"command": "auth",
"command_ref": "command ref",
"args" :
{
"token": "TOKEN",
}
}
OK
{
"command": "response",
"command_ref": "command ref",
"success": true
}
re-auth notification
Client Server
Authentication Responses
Various responses from the server for authentication/re-authentication are shown as below,
If Client reauths to re-authentication notification within the grace time period, the client
session will be refreshed,
{
"command": "response",
"command_ref": "command reference",
"success": true,
}
If client reauthenitcates with different token than the one used for initial authentication,
server will respond with the following error
{
"command": "response",
"command_ref": " command reference ",
"success": false,
"error":
{
"code": 498,
"status": " Invalid Token ",
"message": " The client had not sent previously used token. If client
needs new session, please disconnect and connect with new token "
}
}
If Client fails to reauthenticate within Gracetime, the client session will be disconnected and
all the subscriptions are cleared and server will send a notification as shown below
{
"command": "server notification",
"command_ref": "Session expired",
"message": "Session is expired"
}
Errors
This command may return the following error messages:
The client had not sent previously used token. If client needs new session, please disconnect
and connect with new token
Commands
The TradeSense WebSocket API commands allows to:
Client Server
Authentication
phase ends
Command
{
"command": "command type",
"command_ref": "command ref",
"args" :
{
...
}
}
Response
{
"command": "response",
"command_ref": "command ref",
"success": true,
"data" :
{
...
}
}
Client Server
After successfully completing the authentication phase the client is allowed to send commands to
the Server:
{
"command":"command type",
"command_ref":"command reference",
"args":{}
}
Mandatory:
command : type of the command;
command_ref : the reference of the command is a string value generated by the client-side.
This reference is used to identify the response linked to client's request;
Optional:
Fetch data
Available commands:
get_zones
get_turrets
get_users
get_events
get_calls
Get Zones
{
"command":"get_zones",
"command_ref":"command reference",
"args":{}
}
The response from the server will contain a list of Zone objects.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"zones":[
{
"id":"003O90001",
"name":"Zone Assure (emtpy)",
"locationCountryCode":null,
"locationRegion":null,
"locationCity":null,
"callPrefix":null
},
{
"id":"003NV0001",
"name":"Assure (Verba)",
"locationCountryCode":"BE",
"locationRegion":"Province de Liège",
"locationCity":"Huy",
"callPrefix":"04"
}
]
}
}
Optionals arguments
{
"command":"get_zones",
"command_ref":"command reference",
"args":
{
"search": "value",
"operator": "contains",
"limit": response limit
}
}
The TradeSense WBA will return all the entries which satisfies the search arguments.
Zone name
Errors
Get Turrets
{
"command":"get_turrets",
"command_ref":"command reference",
"args":{}
}
The response from the server will contain a list of Turret objects.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"turrets":[
{
"name":"T4-LOADTEST1",
"alive":true,
"tssVersion":"default",
"zone":"Assure (Verba)",
"username": "612341089",
"firmwareVersion":"R9.3_5.50278",
"firmwareTargetVersion":null,
"model":"1015"
},
{
"name":"T4-LOADTEST2",
"alive":true,
"tssVersion":"default",
"zone":"Assure (Verba)",
"username": null,
"firmwareVersion":"R9.3_5.50278",
"firmwareTargetVersion":null,
"model":"1015"
}
]
}
}
The property "firmwareTargetVersion" is the target version for upgrade. This property will
be set only pending upgrade process.
Optionals arguments
{
"command":"get_turrets",
"command_ref":"command reference",
"args":
{
"search": "value",
"operator": "begins_with",
"limit": response limit
}
}
The TradeSense WBA will return all the entries which satisfies the search arguments.
Turret name
Errors
Get Users
Retrieves data for all the Users linked to the Zones managed by Assure.
{
"command":"get_users",
"command_ref":"command reference",
"args":{}
}
The response from the server will contain a list of Users objects with their lines.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"users":[
{
"login":"612341089",
"firstName":"IPTNetrix1",
"lastName":"Turret1",
"turret": "T4-LOADTEST1",
"zone":"Assure",
"status":"ACTIVE",
"primaryLine":"+99999993201",
"profile":{
"lines":[
{
"userExtension": "+99999304300",
"userDisplayName": "PW 3043",
"lineType": "DDI",
"tpoDnsName": "dnsName",
"subscriptionState": "SUBSCRIBED",
"defaultGlobalLine": false,
"voiceRecording": true,
"place":{
"name": "placeName",
"type": "RINGDOWN_DYNAMIC",
"state": "STARTED",
"cluster": "clusterName",
"groupId": 1234
},
"slots": [
{
"slot": "304301",
"label": "ARD 304301",
"type": "PERMANENT",
"target": "304301@Vega400G02",
"mrd": true,
"ard": "FIRST_USER",
"answer_only": null (or true/false)
},
{
"slot": "304302",
"label": "MRD 304302",
"type": "PERMANENT",
"target": "304302@Vega400G02",
"mrd": true,
"ard": "ALWAYS",
"answer_only": null (or true/false)
}
],
"virtualSlotStart": null,
"virtualSlotEnd": null
},
]
}
}
]
}
}
Optionals arguments
{
"command":"get_users",
"command_ref":"command reference",
"args":
{
"search": "value",
"operator": "is_exactly",
"limit": response limit
}
}
The TradeSense WBA will return all the entries which satisfies the search arguments.
User login
User firstname
User lastname
Errors
Get Events
Limitation
To prevent performance degradation over time, the application will only return the most recent
records. The default value is set to 2 days and can be overrided in application settings.
application.global.wba.db.fetch.max.interval
Using ID
The client-side are allowed to retrieve all the events by categories. Indicate the segment of events
using from_id and to_id keys. If to_id is not specified then all the events from indicated id will
be sent.
{
"command":"get_events",
"command_ref":"command reference",
"args":{
"category":"event category",
"from_id":event_id,
"to_id":event_id
}
}
Possible values :
calls
presences
from_id : the id of the first element of the batch that the third party request
to_id : the id of the last element of the batch that the third party request
Using datetime
The client-side are also allowed to retrieve events by datetime. Indicate the segment of calls using
start_time and end_time keys.
{
"command":"get_events",
"command_ref":"command reference",
"args":{
"category":"event category",
"start_time":"datetime",
"end_time":"datetime"
}
}
Possible values :
calls
presences
start_time : the datetime concidered as start
Response
The response from the server will contain a list of Event objects.
The event with asked from_id will be considered as already received by the third party, and
then will not be included in the returned batch. However the event with the to_id will be
included in the batch.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"current_batch":1,
"last_batch":1,
"events":[
{
"event_id":event id,
"turret":"turret name",
"zone":"zone",
"login":"login",
"device":"HS1",
"microphone_state":"On",
"local_extension":"6018",
"remote_extension":"6017",
"call_direction":"OUTGOING",
"call_ref":"call ref",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
},
{
"event_id":event id,
"turret":"turret name",
"zone":"zone",
"login":"login",
"device":"HS1",
"microphone_state":"On",
"local_extension":"6018",
"remote_extension":"6017",
"call_direction":"OUTGOING",
"call_ref":"call ref",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
}
]
}
}
When making calls that return a large number of results as a list, WBA will page the result set in
batch of 100. The current and the last batch number will be referred in the data object.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"current_batch":1,
"last_batch":10,
"events":[
{
"event_id":event id,
"turret":"turret name",
"zone":"zone",
"login":"login",
"device":"HS1",
"microphone_state":"On",
"local_extension":"6018",
"remote_extension":"6017",
"call_direction":"OUTGOING",
"call_ref":"call ref",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
},
{
"event_id":event id,
"turret":"turret name",
"zone":"zone",
"login":"login",
"device":"HS1",
"microphone_state":"On",
"local_extension":"6018",
"remote_extension":"6017",
"call_direction":"OUTGOING",
"call_ref":"call ref",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
},
"..."
]
}
}
Errors
Get Calls
Limitation
To prevent performance degradation over time, the application will only return the most recent
records. The default value is set to 2 days and can be overrided in application settings.
application.global.wba.db.fetch.max.interval
Using ID
The client-side are allowed to retrieve calls with corresponding events. Indicate the segment of
calls using from_id and to_id keys. If to_id is not specified then all the calls from indicated id
will be sent.
{
"command":"get_calls",
"command_ref":"command reference",
"args":{
"from_id":call id,
"to_id":call id
}
}
from_id : the id of the first call of the batch that the third party request
to_id : the id of the last call of the batch that the third party request
all (default)
in_progress
done
Using datetime
The client-side are also allowed to retrieve calls by datetime. Indicate the segment of calls using
start_time and end_time keys. Only calls started during the segment will be returned.
{
"command":"get_calls",
"command_ref":"command reference",
"args":{
"start_time":"datetime",
"end_time":"datetime"
}
}
all (default)
in_progress
done
Using call_ref
The client-side are also allowed to retrieve a single call by its call_ref .
{
"command":"get_calls",
"command_ref":"command reference",
"args":{
"call_ref":"2147491577@601602"
}
}
Using filter
{
"command":"get_calls",
"command_ref":"command reference",
"args":{
"filter":filter
}
}
all
in_progress
done
Response
The response from the server will contain a list with the call object and its events.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"current_batch":1,
"last_batch":1,
"calls":[
{
"call_id":call id,
"call_ref":"2147491577@601602",
"turret":"turret name",
"login":"login",
"local_extension":"6018",
"remote_extension":"6019",
"call_direction":"OUTGOING",
"call_start_time":"2020-05-08T15:57:19Z",
"call_end_time":"2020-05-08T15:57:24Z",
"sip_call_id": "3136a8e-735608ff-68c2e-919cfd0-a61ddd0a-13c4-759",
"events":[
{
"event_id":event id,
"operation":"Ringing",
"device":"HS1",
"microphone_state":"Off",
"time":"2020-05-08T15:57:19Z"
},
{
"event_id":event id,
"operation":"Connected",
"device":"HS1",
"microphone_state":"Off",
"time":"2020-05-08T15:57:19Z"
},
{
"event_id":event id,
"operation":"Disconnected",
"device":"HS1",
"microphone_state":"Off",
"time":"2020-05-08T15:57:24Z"
}
],
"created_at":"2020-05-11T16:19:34Z"
}
]
}
}
Possible values:
device : turret audio device name where the call is actually hosted
HS1
HS2
LD1.1
LD2.4
microphone_state : state of the microphone
On
Off
Errors
Call a service
Available services:
Click To Dial
Attended mode
Unattended mode
Make a conference call
The server-side will respond to each command with an object data containing the call_ref .
This response doesn't mean that the command are actually executed by the turret but that the
command was successfully transmitted.
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"place",
"login":"user login",
"remote_extension":"extension to call",
"local_extension":"Line",
"ddi_slot":"DDI slot extension",
"device":"device"
}
}
Mandatory:
Optional:
The remote_extension , local_extension and ddi_slot are all optional but at least one
parameter is necessary.
Permissible combinations:
remote_extension alone
remote_extension and local_extension
remote_extension and ddi_slot
ddi_slot alone
Limitation
Default settings will refresh data every couple of minute. In order to get real time data about line
registration state, target user must be configured with :
profile.setting.crm.linestate.enable = true
Before placing the call, the application will check for local extension availability.
An outgoing call can fail for practical reasons. In that case, an additional call event will be sent
with the failure reason in the state field.
These additional call events are not saved in assure or WBA. They are only here to notify
subscribers why the call cannot complete and to allow them to clear the call from the turret.
{
"event_id": null,
"turret": "TS-TURRET-01",
"zone": "Belgium - Liege - FHO",
"login": "fho3",
"device": "HS1",
"microphone_state": "OFF",
"local_extension": "6202",
"remote_extension": "6402",
"call_direction": "OUTGOING",
"call_ref": "2147483671@620202",
"state": "Extension has no free slot available",
"created_at": "2022-01-13T23:20:35Z"
}
Extension is unreachable
Extension has no free slot available
This is only available for turrets running firmware 9.5.12, 9.7.1 or later.
Response
The server will respond with an object data containing the call_ref . Subsequent actions or
notifications will use that reference to identify the call. The server will also provide
local_extension that will actually be used to host the call.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"action":"place",
"login":"user login",
"turret":"turret name",
"call_ref":"call ref",
"local_extension":"Line or DDI slot extension"
}
}
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"accept",
"login":"user login",
"call_ref":"call ref",
"device":"device"
}
}
Mandatory:
Optional:
device : The audio device that will be used to host the call: in the IPTrade turret audio
device format (HS1,HS2, LD1.1, LD2.4, …). If not specified, the turret uses the current selected
or active handset.
Mandatory:
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"resume",
"login":"user login",
"call_ref":"call ref"
}
}
Mandatory:
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"terminate",
"login":"user login",
"call_ref":"call ref"
}
}
Mandatory:
action : action must be terminate
login : user login
call_ref : the reference of the call to hold
Dispatching request will transfer an opened call to a specified target extension without follow-up.
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"dispatch",
"login":"user login",
"call_ref":"call ref",
"remote_extension":"extension to call"
}
}
Mandatory:
With the Transfer feature, an ongoing call can be transferred to another party. This can be made
in two different manner, attended or unattended mode.
Limitation
The two calls are both DDI calls or non DDI calls
The two calls are established
For transfer off DDI calls from a non-default DDI line, please be aware that the target turret must
be configured with:
profile.setting.ddi.advanced.handling.on.all = true
Attended
Party A Party B Party C
Opened call
Party A is in a call
with Party B
Opened call
Party A is now
removed from the
call between
Party B and Party C.
Opened call
Let’s say that Party A is in a call with Party B. To transfer the call to Party C, Party A will proceed as
follow:
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"hold_transfer",
"call_ref":"call ref"
}
}
Established call with B must be held in special hold_transfer mode. Then establish a new call
using action new and the same local_extension as the transferred call.
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"new",
"login":"user login",
"remote_extension":"extension to call",
"local_extension":"Line or DDI slot extension"
}
}
Mandatory:
action : action must be new as you need to establish a new call before performing the
transfer
login : user login
remote_extension : remote target phone extension to contact
local_extension : the local extension must be the same as the one used for the
transferred call
As for the place call command, local extension availability will be verified.
When Party C will pick-up the call. A notification will be sent to the client-side with the reference of
the new call. To finish the transfer phase, send the action perform_transfer using both call ref.
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"perform_transfer",
"login":"user login",
"call_ref_source":"call ref",
"call_ref_destination":"call ref"
}
}
Mandatory:
The source call for transfer is always the last call put on-hold with the hold_transfer mode. If
this call is terminated or resumed, the transfer is not available anymore, even if there are other
calls that have been previously put on-hold.
If the Party C do not pick up the call, Party A can resume the call and continue to talk to Party B.
{
"command":"service_ctd",
"command_ref":"command reference",
"args":{
"action":"resume",
"call_ref":"call ref"
}
}
Unattended
Party A Party B Party C
Opened call
Party A is in a call
with Party B
Party A is now
removed from the
call between
Party B and Party C.
Opened call
The only difference with the attended transfer is that Party A do not wait to establish the call and
perform the transfer directly after placing the call to Party C. Thus the party A will be removed
from the call and will not be able to resume it.
Make a conference call
Limitation
Party A is in a call
with Party B
Opened call
Party A is in a call
with Party C
Opened call
Initiate Conference
A B and C
are in conference call
Let's say A is in a call with B and with C, but B and C can't talk to each others. To start a
conference, Party A should initiate a conference call.
Mandatory:
When the conference call will be established between all parties, only the call_ref_source will
be kept. The call_ref_destination will be terminated. call_ref_source will then be able to
host new participant.
Errors
If the configured time out interval for click to dial requests is reached (see settings section)
Subscribe to Notifications
Client Server
Command
{
"command": "subscribe",
"command_ref": "command ref",
"args" :
{
"category": "calls",
}
}
Response
{
"command": "return",
"command_ref": "command ref",
"success": true,
"data" :
{
"category": "calls",
"last_id": last id,
}
}
Client Server
The command subscribe will subscribe your client-side to the event bus. You can either listen to
all events or to a specific event category. If you want to listen to multiple event categories, you will
have to send multiple subscribe commands.
{
"command":"subscribe",
"command_ref":"command reference",
"args":{
"category":"events category"
}
}
Mandatory:
The server will respond with a result message to indicate that the subscription is active.
{
"command":"response",
"command_ref":"command reference",
"success":true,
"data":{
"category":"calls",
"last_id":last event id
}
}
Client-side will receive the last event id available on server-side. If this id is different from the last
received event, the client is able to request the server to re-transmit all the missed events (see
Get Events).
calls : receive all the notification for all alive calls and their state evolution
presences : receive all the notification for presence state on turret.
Errors
Notifications
In order to avoid an overflow of notifications, TradeSense API sends notifications grouped by sets.
When a client-side is subscribed, server-side will send a message every second with all last
notifications received.
Calls notifications
TradeSense API allows third party to obtain contextual information to be eventually displayed
when a call is either on the active handset, in ringing state or in held state. To be able to monitor
all alive calls and their state evolution.
{
"command":"notify",
"data":{
"category":"calls",
"events":[
{
"event_id":event id,
"turret":"turret name",
"zone":"zone",
"login":"login",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"6018",
"remote_extension":"6017",
"call_direction":"OUTGOING",
"call_ref":"call ref",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
},
{
"event_id":event id,
"turret":"turret name",
"zone":"zone",
"login":"login",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"6018",
"remote_extension":"6017",
"call_direction":"OUTGOING",
"call_ref":"call ref",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
}
]
}
}
event_id : event id
device : turret audio device name where the call is actually hosted
HS1
HS2
LD1.1
LD2.4
microphone_state : state of the microphone
ON
OFF
null
local_extension : local extension used for the call
OUTGOING
INCOMING
call_ref : call reference
Ringing
Connected
Held
Held Transfer
Disconnected
Dispatched
Transferred
In Conference
created_at : the exact time when the call switch to the indicated state
If A want to establish a call with B. For an outgoing call TradeSense WBA will notify all the
subscribers with following notifications:
Third party on A side send a request to initiate a new call from A to B. Here we will use DDI
slot id as local extension to specify the slot.
{
"command":"service_ctd",
"command_ref":"201",
"args":{
"action":"place",
"login":"A",
"remote_extension":"200",
"local_extension":"10001"
}
}
A response will be sent back to notify if the request was successfully took into account
{
"command":"response",
"command_ref":"201",
"success":true,
"data":{
"action":"place"
}
}
All the subscribers on B side events will be notified with an incoming call event. Multiple
events messages will be sent if multiple users subscribe/monitor the line.
{
"command":"notify",
"data":{
"category":"calls",
"events":[
{
"event_id":1,
"turret":"Turret_B",
"zone":"Zone_Name",
"login":"B",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"200",
"remote_extension":"100",
"call_direction":"INCOMING",
"call_ref":"CALLREF01",
"state":"Ringing",
"created_at":"2020-05-07T18:13:03Z"
}
]
}
}
Third party on B side send a request to accept the incoming call. Here we will use DDI slot id
as local extension to specify the slot.
{
"command":"service_ctd",
"command_ref":"301",
"args":{
"action":"accept",
"login":"B",
"call_ref":"CALLREF01",
"device":"HS1"
}
}
A response will be sent back to notify if the request was successfully took into account
{
"command":"response",
"command_ref":"301",
"success":true,
"data":{
"action":"accept"
}
}
When B will pick up the call. All the subscribers on A and B side events will be notified with an
Connected call event.
On side A:
{
"command":"notify",
"data":{
"category":"calls",
"events":[
{
"event_id":1,
"turret":"Turret_A",
"zone":"Zone_NameA",
"login":"A",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"10001",
"remote_extension":"200",
"call_direction":"OUTGOING",
"call_ref":"CALLREF01",
"state":"Connected",
"created_at":"2020-05-07T18:13:03Z"
}
]
}
}
On side B:
{
"command":"notify",
"data":{
"category":"calls",
"events":[
{
"event_id":1,
"turret":"Turret_B",
"zone":"Zone_NameB",
"login":"B",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"20001",
"remote_extension":"100",
"call_direction":"INCOMING",
"call_ref":"CALLREF01",
"state":"Connected",
"created_at":"2020-05-07T18:13:03Z"
}
]
}
}
{
"command":"service_ctd",
"command_ref":"202",
"args":{
"action":"terminate",
"call_ref":"CALLREF01"
}
}
A response will be sent back to notify if the request was successfully took into account
{
"command":"response",
"command_ref":"202",
"success":true,
"data":{
"action":"terminate"
}
}
As soon as the call is ended, all the subscribers on side A and B will be notified with an
Disconnected call event
On side A:
{
"command":"notify",
"data":{
"category":"calls",
"events":[
{
"event_id":1,
"turret":"Turret_A",
"zone":"Zone_NameA",
"login":"A",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"10001",
"remote_extension":"200",
"call_direction":"OUTGOING",
"call_ref":"CALLREF01",
"state":"Disconnected",
"created_at":"2020-05-07T18:13:03Z"
}
]
}
}
On side B:
{
"command":"notify",
"data":{
"category":"calls",
"events":[
{
"event_id":1,
"turret":"Turret_B",
"zone":"Zone_NameB",
"login":"B",
"device":"HS1",
"microphone_state":"ON",
"local_extension":"20001",
"remote_extension":"100",
"call_direction":"INCOMING",
"call_ref":"CALLREF01",
"state":"Disconnected",
"created_at":"2020-05-07T18:13:03Z"
},
"..."
]
}
}
Error handling
If 401 Unauthorized error response is received, then client needs to re-authenticate and subscribe
to notifications.
Presence notifications
TradeSense API will notify all the subscribers with a presence message that the user has just
performed a login or logout.
{
"command":"notify",
"data":{
"category":"presences",
"events":[
{
"event_id":event id,
"turret":"turret name",
"login":"user login",
"zone":"turret's zone",
"state":"presence state",
"created_at":"datetime"
},
{
"event_id":event id,
"turret":"turret name",
"login":"user login",
"zone":"turret's zone",
"state":"presence state",
"created_at":"datetime"
}
]
}
}
event_id : event id
turret : turret name
login : user login
state : the current state of the presence
created_at : the exact time when the presence switched to the indicated state
Presence state values
TradeSense API will notify all the subscribers with information about users presence on turrets.
Settings
It is possible to change default values by overriding the setting in the productivity tools clusters
TSS page.
Ping settings
application.global.wba.ping.enabled True
Notifications settings
In order to avoid an overflow of notifications, WBA sends notifications grouped by batches. When
a client-side is subscribed, server-side will send a message every N milliseconds with all last
notifications received.
application.global.wba.notification.batch.size 100
As we don't have feedback from the turrets, when using the click to dial service, we need to
monitor incoming events in order to be able to check if the request was executed.
This setting configure the time interval to wait for the event before sending an error message.
This setting configure how often we check for timed out ctd requests.
To avoid being overloaded by requests, incoming messages are only processed if not already
timed out.
This setting configure the time interval to wait for a regular request to be timed out.
To avoid too many records being returned, we set a maximum fetch interval in days.
Setting key
Support
Requirements
The application relies on data gathered from gecko and enriched through assure. Both of them
needs to be started and properly configured to report valid real time information and to monitor
the click to dial service.
Startup
The application won't allow user to connect until gecko is started, provisionned and his caches
updated. This can take a few minutes.
Provisioning
When performing assure first time configuration, gecko's address must be provided (the platform)
and assure will start retrieving data from gecko's api.
Errors
Commands
Log Level
When asking for support, the user will often be required to provide the logs of the application.
The loglevel command allows the user to get the current level and to change it.
{
"command" : "loglevel",
"command_ref" : "command reference"
}
The response from the server will return the current level.
{
"command": "loglevel",
"command_ref": "command reference",
"args": {
"level": "DEBUG"
}
}
{
"command" : "loglevel",
"command_ref" : "command reference",
"args": {
"level": "info"
}
}
The response from the server will return the previous and current level.
{
"command": "response",
"command_ref": "command reference",
"success": true,
"data": {
"previous_level": "DEBUG",
"current_level": "INFO"
}
}
Available levels
Errors
Get Health
{
"command" : "get_health",
"command_ref" : "command reference"
}
The response from the server will return completion status for assure and gecko.
{
"command": "response",
"command_ref": "command reference",
"success": true,
"data": {
"provisioning": {
"assure": {
"completed": true,
"last_refresh": "2021-09-24T12:00:00Z"
},
"gecko": {
"completed": true,
"recently_updated": true,
"max_age": 10
}
}
}
}
Information about gecko are read from its API health path.
Provisioning data items
Errors