Table of Contents

Cisco Finesse - Redbox Call Suppression Gadget - Sequence Diagrams

These are the sequence diagrams between the Finesse Server and the recorder. All REST requests are sent via Finesse Server using the MakeRequest() function from the Gadgets API

High Level - How the Gadget Works

Login

<sequencediagram>

  Finesse Server->Redbox: HTTP POST - /api/v1/sessions/login [username/password set in headers]
  Redbox->Finesse Server: 200 OK - Body: {"authToken": "b6b14951-a7db-4e2a-895b-c6bf96ecbe6a"}
  Note left of Finesse Server: Login

</sequencediagram>

Success

Error

Example HTTP LOGIN Request

POST /api/v1/sessions/login HTTP/1.1
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
password: xkzdBbQSCUBrwx8W
requestId: 3a59c4cc-617f-4846-9ff7-1e9f204b61a3
username: redboxapi
X-Forwarded-For: 10.123.123.20
X-shindig-dos: on
Content-Length: 0
Host: redbox1.mydomain.com:1480
Connection: Keep-Alive
User-Agent: Apache Shindig
Accept-Encoding: gzip, deflate

HTTP/1.1 200 OK
Content-Length: 52
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Mar 2021 12:14:37 GMT

{"authToken":"fe9f3f8f-fa71-45ef-aa2b-98c6f9dbfcc0"}

Device List

<sequencediagram>

  Finesse->Redbox: HTTP GET - /api/v1/config/devices [authToken set in headers]
  Redbox->Finesse: 200 OK - Body: (see below)
  Note left of Finesse: Device List

</sequencediagram>

Example Response

{
    "devices": [
        {
            "channelName": "Alice",
            "deviceID": 2,
            "extension": "12021 (csfAlice)"
        },
        {
            "channelName": "Bob Bobster",
            "deviceID": 1,
            "extension": "12022 (SEP38ED1855072B)"
        },
        {
            "channelName": "Bob Bobster",
            "deviceID": 4,
            "extension": "12022 (ipcGerry)"
        },
        {
            "channelName": "Danny",
            "deviceID": 3,
            "extension": "12026 (SEP38ED1855072B)"
        }
    ]
}

Success (if (response.rc >= 200 && response.rc < 300 && handlers.success))

Error

Example HTTP Request

GET /api/v1/config/devices?nocache=1615378477047 HTTP/1.1
authToken: fe9f3f8f-fa71-45ef-aa2b-98c6f9dbfcc0
requestId: 9a917dd8-a080-4aeb-acac-fb911c6d0d2e
X-Forwarded-For: 10.123.123.20
X-shindig-dos: on
Host: redbox1.mydomain.com:1480
Connection: Keep-Alive
User-Agent: Apache Shindig
Accept-Encoding: gzip, deflate

HTTP/1.1 200 OK
Content-Length: 2361
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Mar 2021 12:14:37 GMT

{
    "devices": [
        {
            "channelName": "Alice",
            "deviceID": 2,
            "extension": "12021 (csfAlice)"
        },
        {
            "channelName": "Bob Bobster",
            "deviceID": 1,
            "extension": "12022 (SEP38ED1855072B)"
        },
        {
            "channelName": "Bob Bobster",
            "deviceID": 4,
            "extension": "12022 (ipcGerry)"
        },
        {
            "channelName": "Danny",
            "deviceID": 3,
            "extension": "12026 (SEP38ED1855072B)"
        }
    ]
}

Keepalive

<sequencediagram>

  Finesse->Redbox: HTTP PUT /api/v1/sessions/keepAlive[authToken set in headers]
  Redbox->Finesse: 200 OK - Body: {}
  Note left of Finesse: Keepalive

</sequencediagram>

//Note:
The keepAlive request is present to avoid sessions timing out which by default will happen after 5 minutes of inactivity. This is provided to allow a good response time to suppression requests by not needing to re-establish a session should it expire before other commands can be triggered. Note that an HTTP return code of 401 with extra information of the token being invalid can still be sent in response to any request (excluding login/logout) due to external factors and therefore should be handled appropriately.

This Finesse Gadget keepalive timer is set by default to 150 seconds. Which is 50% of the session timeout of 5 minutes - as detailed above. //

Success (if (response.rc >= 200 && response.rc < 300 && handlers.success))

setTimeout(function () {
            _keepalive();
        }, _keepaliveInterval);
    }

Error

Example HTTP KeepAlive Request and Response

PUT /api/v1/sessions/keepAlive HTTP/1.1
authToken: 9dd00e7a-707d-41bd-82d5-793963831b34
requestId: 49a57510-074b-4ec6-a5b7-d77d9a9a3970
X-Forwarded-For: 10.123.123.20
X-shindig-dos: on
Content-Length: 0
Host: redbox1.mydomain.com:1480
Connection: Keep-Alive
User-Agent: Apache Shindig
Accept-Encoding: gzip, deflate

HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Mar 2021 11:41:49 GMT
{}

Start Suppression

<sequencediagram>

  Finesse->Redbox: HTTP POST /api/v1/suppression/start/device [{"deviceID": 202}]
  Redbox->Finesse: 200 OK - Body: {}
  Note left of Finesse: Start Suppression    

</sequencediagram>

Success

Error

Example HTTP Start Suppression

POST /api/v1/suppression/start/device HTTP/1.1
authToken: 9dd00e7a-707d-41bd-82d5-793963831b34
Content-Type: application/json
requestId: 7bdaa408-04e8-47fc-b551-2f7120112c64
X-Forwarded-For: 10.123.123.20
X-shindig-dos: on
Content-Length: 17
Host: redbox1.mydomain.com:1480
Connection: Keep-Alive
User-Agent: Apache Shindig
Accept-Encoding: gzip, deflate

{"deviceID": 202}

HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Mar 2021 11:41:15 GMT
{}

Stop Suppression

<sequencediagram>

  Finesse->Redbox: HTTP POST /api/v1/suppression/stop/device [{"deviceID": 202}]
  Redbox->Finesse: 200 OK - Body: {}
  Note left of Finesse: Stop Suppression    

</sequencediagram>

Success

Error

Example HTTP Stop Suppression

POST /api/v1/suppression/stop/device HTTP/1.1
authToken: 9dd00e7a-707d-41bd-82d5-793963831b34
Content-Type: application/json
requestId: 4caaa138-a07c-4228-a0e4-b202aaaadd59
X-Forwarded-For: 10.123.123.20
X-shindig-dos: on
Content-Length: 17
Host: redbox1.mydomain.com:1480
Connection: Keep-Alive
User-Agent: Apache Shindig
Accept-Encoding: gzip, deflate

{"deviceID": 202}

HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Mar 2021 12:13:19 GMT

{}

Logout

<sequencediagram>

  Finesse->Redbox: HTTP POST /api/v1/sessions/logout
  Redbox->Finesse: 200 OK - Body: {}
  Note left of Finesse: Logout

</sequencediagram>

Example HTTP Logout Request

POST /api/v1/sessions/logout HTTP/1.1
Content-Type: application/xml
X-egain-session: d8a1d8fc-b82a-49b7-b4ab-76e1476ad19d
authToken: 9dd00e7a-707d-41bd-82d5-793963831b34
cache-control: no-cache
Accept: */*
Host: redbox1.mydomain.com:1480
accept-encoding: gzip, deflate
content-length: 201
Connection: keep-alive

HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Mar 2021 16:30:51 GMT

{}