---
notionId: "1c401292710f4f4fba1be02d7df39f3c"
product: "developer"
cluster: "apis"
intent: "developer.call-center"
docSlug: "call-center"
task: "Call Center in the API"
title: "Call Center in the API | VirtualPBX"
meta_description: "Qubicle is the call-queue application on the Dash API. It lets an account assign VirtualPBX users as recipients and distribute inbound calls across one or many"
answer: "Qubicle is the call-queue application on the Dash API. It lets an account assign VirtualPBX users as recipients and distribute inbound calls across one or many queues. Each queue has its own configuration for how those calls are offered. Sessions and events describe a call while it waits and while a recipient handles it. Use the queue, recipient, session, and event requests to build against that API."
audience: "user"
updated: "2022-12-06"
legacy: ["call-center"]
headings: [{"depth":2,"text":"About Call Center","id":"about-call-center"},{"depth":3,"text":"Concepts","id":"concepts"},{"depth":3,"text":"Queues","id":"queues"},{"depth":3,"text":"Recipients","id":"recipients"},{"depth":3,"text":"Sessions","id":"sessions"},{"depth":3,"text":"Events","id":"events"},{"depth":3,"text":"Session Events","id":"session-events"},{"depth":3,"text":"Queue Events","id":"queue-events"},{"depth":3,"text":"Recipient Events","id":"recipient-events"},{"depth":3,"text":"Integration","id":"integration"},{"depth":3,"text":"Callflows Integration","id":"callflows-integration"},{"depth":3,"text":"Callflows","id":"callflows"},{"depth":3,"text":"Qubicle Callflow","id":"qubicle-callflow"},{"depth":3,"text":"Configuration","id":"configuration"},{"depth":3,"text":"Queue","id":"queue"},{"depth":3,"text":"Qubicle Recipient Callflow","id":"qubicle-recipient-callflow"},{"depth":3,"text":"Configuration","id":"configuration-1"},{"depth":3,"text":"Link Method","id":"link-method"},{"depth":3,"text":"Action","id":"action"},{"depth":3,"text":"Target Queue","id":"target-queue"},{"depth":3,"text":"Pin Prompt Media","id":"pin-prompt-media"},{"depth":3,"text":"Success Media","id":"success-media"},{"depth":3,"text":"Failure Media","id":"failure-media"},{"depth":2,"text":"APIs","id":"apis"},{"depth":3,"text":"Qubicle Queue API","id":"qubicle-queue-api"},{"depth":3,"text":"Introduction","id":"introduction"},{"depth":3,"text":"Schema","id":"schema"},{"depth":3,"text":"List Queues","id":"list-queues"},{"depth":3,"text":"Queue Status","id":"queue-status"},{"depth":3,"text":"Queue List Status","id":"queue-list-status"},{"depth":3,"text":"Queue Information","id":"queue-information"},{"depth":3,"text":"Create a queue","id":"create-a-queue"},{"depth":3,"text":"Modify a queue","id":"modify-a-queue"},{"depth":3,"text":"List queue sessions","id":"list-queue-sessions"},{"depth":3,"text":"List queue recipients","id":"list-queue-recipients"},{"depth":3,"text":"Set the queue membership","id":"set-the-queue-membership"},{"depth":3,"text":"Clear a queue's membership","id":"clear-a-queues-membership"},{"depth":2,"text":"Qubicle Recipient API","id":"qubicle-recipient-api"},{"depth":3,"text":"List recipients","id":"list-recipients"},{"depth":3,"text":"Get recipient configuration","id":"get-recipient-configuration"},{"depth":3,"text":"Get recipient status","id":"get-recipient-status"},{"depth":3,"text":"Get recipient list status","id":"get-recipient-list-status"},{"depth":3,"text":"Login recipient","id":"login-recipient"},{"depth":3,"text":"Logout recipient","id":"logout-recipient"},{"depth":3,"text":"Set recipient status","id":"set-recipient-status"},{"depth":3,"text":"Extend Wrap-Up Time","id":"extend-wrap-up-time"},{"depth":3,"text":"Cancel Wrap-Up Time","id":"cancel-wrap-up-time"},{"depth":3,"text":"Monitor Recipient","id":"monitor-recipient"},{"depth":2,"text":"Router Types","id":"router-types"},{"depth":3,"text":"Round Robin","id":"round-robin"},{"depth":3,"text":"Configuration","id":"configuration-2"},{"depth":3,"text":"Description","id":"description"},{"depth":3,"text":"Least Calls","id":"least-calls"},{"depth":3,"text":"Configuration","id":"configuration-3"},{"depth":3,"text":"Description","id":"description-1"},{"depth":3,"text":"Least Offers","id":"least-offers"},{"depth":3,"text":"Configuration","id":"configuration-4"},{"depth":3,"text":"Description","id":"description-2"},{"depth":3,"text":"Caveats","id":"caveats"},{"depth":3,"text":"Most Idle","id":"most-idle"},{"depth":3,"text":"Configuration","id":"configuration-5"},{"depth":3,"text":"Description","id":"description-3"},{"depth":3,"text":"Caveats","id":"caveats-1"},{"depth":2,"text":"BLF Status Indication Guide","id":"blf-status-indication-guide"},{"depth":3,"text":"Prerequisites","id":"prerequisites"},{"depth":3,"text":"Configuration","id":"configuration-6"},{"depth":3,"text":"Phone Configuration","id":"phone-configuration"},{"depth":3,"text":"States","id":"states"},{"depth":2,"text":"Using Qubicle as a Recipient via Callflows","id":"using-qubicle-as-a-recipient-via-callflows"},{"depth":3,"text":"Prerequisites","id":"prerequisites-1"},{"depth":3,"text":"References","id":"references"},{"depth":3,"text":"Setup","id":"setup"},{"depth":3,"text":"Configure login callflow","id":"configure-login-callflow"},{"depth":3,"text":"Configure set ready callflow","id":"configure-set-ready-callflow"},{"depth":3,"text":"Configure set away callflow","id":"configure-set-away-callflow"},{"depth":3,"text":"Configure logout callflow","id":"configure-logout-callflow"},{"depth":3,"text":"Typical Use","id":"typical-use"},{"depth":2,"text":"Qubicle User Guide","id":"qubicle-user-guide"},{"depth":3,"text":"Prerequisites","id":"prerequisites-2"},{"depth":3,"text":"Recipient States","id":"recipient-states"},{"depth":3,"text":"Managing state","id":"managing-state"},{"depth":3,"text":"A quick example","id":"a-quick-example"},{"depth":2,"text":"Qubicle Websockets Setup","id":"qubicle-websockets-setup"},{"depth":3,"text":"Introduction","id":"introduction-1"},{"depth":3,"text":"Prerequisites","id":"prerequisites-3"},{"depth":3,"text":"Initiate Websocket connection","id":"initiate-websocket-connection"},{"depth":3,"text":"Subscribe to Qubicle events via Websocket","id":"subscribe-to-qubicle-events-via-websocket"},{"depth":2,"text":"Queue Events","id":"queue-events-1"},{"depth":3,"text":"Create","id":"create"},{"depth":3,"text":"Delete","id":"delete"},{"depth":3,"text":"Sync","id":"sync"},{"depth":3,"text":"Join","id":"join"},{"depth":3,"text":"Leave","id":"leave"},{"depth":3,"text":"Delivered","id":"delivered"},{"depth":2,"text":"Recipient Events","id":"recipient-events-1"},{"depth":3,"text":"Login","id":"login"},{"depth":3,"text":"Logout","id":"logout"},{"depth":3,"text":"Ready","id":"ready"},{"depth":3,"text":"Away","id":"away"},{"depth":3,"text":"Pause","id":"pause"},{"depth":3,"text":"Resume","id":"resume"},{"depth":3,"text":"Wrapup Start","id":"wrapup-start"},{"depth":3,"text":"Wrapup Complete","id":"wrapup-complete"},{"depth":3,"text":"Offer","id":"offer"},{"depth":3,"text":"Reject","id":"reject"},{"depth":3,"text":"Rescind","id":"rescind"},{"depth":3,"text":"Delivered","id":"delivered-1"},{"depth":3,"text":"Hangup","id":"hangup"},{"depth":3,"text":"External Call Start","id":"external-call-start"},{"depth":3,"text":"External Call End","id":"external-call-end"},{"depth":3,"text":"Sync","id":"sync-1"},{"depth":3,"text":"Wiretap Start","id":"wiretap-start"},{"depth":3,"text":"Wiretap Stop","id":"wiretap-stop"},{"depth":3,"text":"Wiretap Failed","id":"wiretap-failed"},{"depth":2,"text":"Session Events","id":"session-events-1"},{"depth":3,"text":"Delete","id":"delete-1"}]
lint: []
---

## About Call Center

Qubicle is an application for providing call queues using VirtualPBX. The Qubicle application allows you to configure VirtualPBX users as recipients for inbound calls distributed amongst one or many queues. Queues are independently configured and will distribute calls according to one of several different routing methods to recipients that have been assigned to that queue that are currently available.

### Concepts

### Queues

A Queue is the primary entity in Qubicle, it represents a queue of sessions that will be distributed according to some routing method to a list of member recipients. The queue process is persistent, and will be running regardless of if there are sessions that are in queue, or if there are recipients logged in.

### Recipients

Recipients are the entity responsible for handling sessions in Qubicle. These can be though of as 'agents' in the logical sense. They encapsulate all data and state needed to determine the current availability for a recipient, the information needed to route a session to the recipient (where to send the call) as well as data that is useful for performance metrics about the recipient. The recipient process's lifetime is tied to a given recipients login state. Offline recipients are not represented in the Qubicle system. The recipient process also handles all external API interaction that allows changing of state and handling of sessions.

### Sessions

Sessions are the entity in Qubicle that represent something that a recipient handles. In the primary case this is an inbound caller. A session is created when you send a call to the Callflows Qubicle endpoint. Once the session is created it is joined into the configured queue for that endpoint and ownership is passed on to Qubicle. The session manages all data related to the entities time is the Qubicle application, such as which queues it has been a part of and for how long, which recipient handled the call, and other data that may be related to the delivery of the entity.

### Events

All entities in Qubicle emit events as they perform the actions needed to route a session to its ultimate destination. Using these events you can obtain real-time information about the state of the system, and the state of these entities.

### Session Events

A session will emit events that are relevant from the perspective of an inbound call.

Session Events

### Queue Events

A queue will emit events for all actions it takes, such as when a session joins and leaves, as well as when it is delivered to a recipient.

Queue Events

### Recipient Events

A recipient will emit events for all sessions that it is handling via a queue, as well as events about the state and availability of the recipient.

Recipient Events

### Integration

The Qubicle application integrates with VirtualPBX to provide call routing and delivery. This integration is achieved by using Callflows to route calls into Qubicle and Blackhole to emit events in real time via Websockets from Qubicle.

### Callflows Integration

There are two callflow modules for Qubicle that allow VirtualPBX to interact with it. The first and primary module is 'cf\_qubicle' which will allow calls to be routed to Qubicle queues. The second is 'cf\_qubicle\_recipient' which will allow calls to control recipient state. This can be used to route a feature code or extension to a callflow that will allow recipients to log in and out from a device.

### Callflows

### Qubicle Callflow

The Qubicle callflow module is used to route calls to a queue in Qubicle.

### Configuration

Plain Text

<pre tabindex="0"><code>    &quot;flow&quot;: {
       &quot;data&quot;: {
            &quot;queue_id&quot; | &quot;id&quot;: {QUEUE_ID},
       },
       &quot;module&quot;: &quot;qubicle&quot;,
       &quot;children&quot;: {
       }
   },</code></pre>

### Queue

The queue parameter is the ID of a qubicle Queue that the call is to be routed to, it can be named either 'queue\_id', or just 'id'

### Qubicle Recipient Callflow

The Qubicle recipient callflow module is used to trigger recipient actions from Callflows.

### Configuration

Plain Text

<pre tabindex="0"><code>   &quot;flow&quot;: {
       &quot;data&quot;: {
            &quot;link_method&quot;: {LINK_METHOD},
            &quot;action&quot;: {ACTION},
            &quot;target_queue&quot;: {TARGET_QUEUE},
            &quot;pin_prompt_media&quot;: {PIN_PROMPT_MEDIA},
            &quot;success_media&quot;: {SUCCESS_MEDIA_ID},
            &quot;failure_media&quot;: {FAILURE_MEDIA_ID},
       },
       &quot;module&quot;: &quot;qubicle_recipient&quot;,
       &quot;children&quot;: {
       }
   },</code></pre>

### Link Method

The link method parameter will determine how the inbound caller is linked to a Qubicle user in order to determine what user to send the action as. It can be one of the following values:

<ul>
<li><p>&quot;device&quot;: The Authorizing-ID of the call will be matched against the owner for the device. If the owner is found and Qubicle enabled, the action is emitted for that owner.</p>
</li>
<li><p>&quot;pin&quot;: The caller is prompted for a pin code that is checked against the &quot;qubicle.pin&quot; configuration key on the users document, if there is a successful match the action is emitted for that user.</p>
</li>
<li><p>&quot;both&quot; (default): The device is checked first, failing a match the caller is then prompted for a pin.</p>
</li>
</ul>

### Action

This will determine the action that is emitted after the call has been linked to a user, the following values are allowed:

<ul>
<li><p>&quot;login&quot;</p>
</li>
<li><p>&quot;logout&quot;</p>
</li>
<li><p>&quot;ready&quot;</p>
</li>
<li><p>&quot;away&quot;</p>
</li>
<li><p>&quot;login_ready&quot; - This will perform BOTH the login and ready actions in one step.</p>
</li>
<li><p>&quot;state_toggle&quot; - This action will log the recipient in and go ready if they are logged out, or log them out if they are logged in.</p>
</li>
</ul>

The "ready" and "away" actions MAY be targeted at a specific queue if the "target\_queue" value is configured to the ID of the Qubicle queue.

### Target Queue

This will ONLY be used when sending a "ready" or "away" action, and will target the per-queue availability setting for the user.

### Pin Prompt Media

This is the ID of a media file that will be played to prompt the caller to enter their pin for linking to a Qubicle recipient enabled user with a configured 'pincode'.

### Success Media

This is the ID of a media file that will be played when the action is successfully emitted.

### Failure Media

This is the ID of a media file that will be played when the action fails (due to the lack of ability to associated a user with the caller).

## APIs

### Qubicle Queue API

### Introduction

This API is used for configuring queues in Qubicle, as well as altering the membership of recipients in queues.

### Schema

Plain Text

<pre tabindex="0"><code>{
    &quot;$schema&quot;: &quot;http://json-schema.org/draft-04/schema#&quot;,
    &quot;_id&quot;: &quot;qubicle_queue&quot;,
    &quot;description&quot;: &quot;Defines a queue in Qubicle&quot;,
    &quot;name&quot;: &quot;Qubicle Call Queue&quot;,
    &quot;properties&quot;: {
        &quot;agent_wrapup_time&quot;: {
            &quot;default&quot;: 0,
            &quot;description&quot;: &quot;Pre-defined wait period applied after an agent handles a customer call (in seconds)&quot;,
            &quot;minimum&quot;: 0,
            &quot;name&quot;: &quot;Agent Wrapup Time&quot;,
            &quot;type&quot;: &quot;integer&quot;
        },
        &quot;force_away_on_reject&quot;: {
            &quot;default&quot;: false,
            &quot;description&quot;: &quot;If set to true and a recipient rejects a call, they will be forced to away state&quot;,
            &quot;type&quot;: &quot;boolean&quot;
        },
        &quot;hold_treatment&quot;: {
            &quot;description&quot;: &quot;Media ID (or appropriate media URI) of media to play while caller is on hold.&quot;,
            &quot;name&quot;: &quot;Hold Treatment&quot;,
            &quot;type&quot;: &quot;string&quot;
        },
        &quot;name&quot;: {
            &quot;description&quot;: &quot;A friendly name for the queue&quot;,
            &quot;maxLength&quot;: 128,
            &quot;minLength&quot;: 1,
            &quot;name&quot;: &quot;Name&quot;,
            &quot;type&quot;: &quot;string&quot;
        },
        &quot;queue_router&quot;: {
            &quot;default&quot;: &quot;route_round_robin&quot;,
            &quot;description&quot;: &quot;The queue router used for routing and delivering calls to recipients&quot;,
            &quot;name&quot;: &quot;Router&quot;,
            &quot;type&quot;: &quot;string&quot;
        },
        &quot;queue_type&quot;: {
            &quot;default&quot;: &quot;queue_basic&quot;,
            &quot;description&quot;: &quot;The type of queue&quot;,
            &quot;enum&quot;: [
                &quot;queue_basic&quot;
            ],
            &quot;name&quot;: &quot;Type&quot;,
            &quot;type&quot;: &quot;string&quot;
        },
        &quot;ring_timeout&quot;: {
            &quot;default&quot;: 20,
            &quot;description&quot;: &quot;Amount of time in seconds that qubicle will wait while ringing for the agent to successfully answer a call.&quot;,
            &quot;minimum&quot;: 1,
            &quot;name&quot;: &quot;Agent Connect Timeout&quot;,
            &quot;type&quot;: &quot;integer&quot;
        },
        &quot;tick_time&quot;: {
            &quot;default&quot;: 1000,
            &quot;description&quot;: &quot;The time between delivery ticks in milliseconds&quot;,
            &quot;minimum&quot;: 250,
            &quot;name&quot;: &quot;Tick Time&quot;,
            &quot;type&quot;: &quot;integer&quot;
        },
        &quot;timeout&quot;: {
            &quot;default&quot;: 3600,
            &quot;description&quot;: &quot;The maximum amount of time in seconds that a call will wait in queue.&quot;,
            &quot;minimum&quot;: 10,
            &quot;name&quot;: &quot;Queue Timeout&quot;,
            &quot;type&quot;: &quot;integer&quot;
        },
        &quot;timeout_if_size_exceeds&quot;: {
            &quot;default&quot;: 0,
            &quot;description&quot;: &quot;If set to a non-zero value the queue will immediately time out any call entering the queue over the size&quot;,
            &quot;type&quot;: &quot;integer&quot;
        },
        &quot;timeout_immediately_if_empty&quot;: {
            &quot;default&quot;: false,
            &quot;description&quot;: &quot;If set to true and a call enters the queue while it has no logged in agents, the call will time out&quot;,
            &quot;type&quot;: &quot;boolean&quot;
        },
        &quot;timeout_redirect&quot;: {
            &quot;description&quot;: &quot;The ID of a queue that the call will be sent to in the event of a timeout&quot;,
            &quot;type&quot;: &quot;string&quot;
        }
    },
    &quot;required&quot;: [
        &quot;name&quot;
    ],
    &quot;type&quot;: &quot;object&quot;
}</code></pre>

### List Queues

This action will list all queues that are configured for the specified account.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;page_size&quot;:{RESULT_COUNT},
    &quot;data&quot;:[
        {
            &quot;id&quot;: &quot;{QUEUE_ID}&quot;,
            &quot;name&quot;: &quot;{QUEUE_NAME}&quot;
        }
    ],
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Queue Status

This action will return the status of the queue.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}/status

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/status</code></pre>

\{
    "data": \{
            "active\_recipient\_count": \{ACTIVE\_RECIPIENT\_COUNT\},
            "available\_recipient\_count": \{AVAILABLE\_RECIPIENT\_COUNT\},
            "stats": \{
                "estimated\_wait": \{EST\_WAIT\_TIME\},
                "average\_wait": \{AVG\_WAIT\_TIME\},
                "recipient\_count": \{RECIPIENT\_COUNT\},
                "active\_session\_count": \{ACTIVE\_SESSION\_COUNT\},
                "total\_sessions": \{TOTAL\_SESSION\_COUNT\},
                "missed\_sessions": \{MISSED\_COUNT\},
                "abandoned\_sessions": \{ABANDONED\_COUNT\}
            \},
            "node": \{RUNNING\_ON\_NODE\}
    \},
    "revision":"\{REVISION\}",
    "request\_id":"\{REQUEST\_ID\}",
    "status":"success",
    "auth\_token":"\{AUTH\_TOKEN\}"
\}

<ul>
<li><p>Active-Session-Count: Count of currently active sessions in the queue</p>
</li>
<li><p>Recipient-Count: Count of total configured recipients for the queue</p>
</li>
<li><p>Active-Recipient-Count: Count of currently active recipients (logged in)</p>
</li>
<li><p>Available-Recipient-Count: Count of currently available recipients (ready to take a call)</p>
</li>
<li><p>Estimated-Wait: The currently estimated wait time for a session in queue</p>
</li>
<li><p>Average-Wait: The DAILY average wait time for all sessions</p>
</li>
<li><p>Total-Sessions: The DAILY total session count for the queue</p>
</li>
<li><p>Missed-Sessions: The DAILY total count of missed sessions (sessions that timed out without being handled)</p>
</li>
<li><p>Abandoned-Sessions: The DAILY total count of abandoned sessions (session left queue prior to being handled)</p>
</li>
<li><p>Node: The node that the queue process is running on</p>
</li>
</ul>

### Queue List Status

This action will return the status for the listed queues

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/status

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/status -d '{&quot;data&quot;:{&quot;queue_ids&quot;:[{QUEUE_ID_1},{QUEUE_ID_2}]}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        {QUEUE_ID_1}: {
            &quot;active_recipient_count&quot;: {ACTIVE_RECIPIENT_COUNT},
            &quot;available_recipient_count&quot;: {AVAILABLE_RECIPIENT_COUNT},
            &quot;stats&quot;: {
                &quot;estimated_wait&quot;: {EST_WAIT_TIME},
                &quot;average_wait&quot;: {AVG_WAIT_TIME},
                &quot;recipient_count&quot;: {RECIPIENT_COUNT},
                &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
                &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
                &quot;missed_sessions&quot;: {MISSED_COUNT},
                &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
            },
            &quot;node&quot;: {RUNNING_ON_NODE}
        },
        {QUEUE_ID_2}: {
            &quot;active_recipient_count&quot;: {ACTIVE_RECIPIENT_COUNT},
            &quot;available_recipient_count&quot;: {AVAILABLE_RECIPIENT_COUNT},
            &quot;stats&quot;: {
                &quot;estimated_wait&quot;: {EST_WAIT_TIME},
                &quot;average_wait&quot;: {AVG_WAIT_TIME},
                &quot;recipient_count&quot;: {RECIPIENT_COUNT},
                &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
                &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
                &quot;missed_sessions&quot;: {MISSED_COUNT},
                &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
            },
            &quot;node&quot;: {RUNNING_ON_NODE}
        }
    },
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Queue Information

This action will return all configuration data for a specific queue.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;name&quot;:&quot;{QUEUE_NAME}&quot;,
        &quot;queue_type&quot;:&quot;queue_basic&quot;,
        &quot;queue_router&quot;:&quot;{ROUTER_TYPE}&quot;,
        &quot;timeout&quot;:{TIMEOUT},
        &quot;hold_treatment&quot;:&quot;{MEDIA_ID_FOR_HOLD_TREATMENT}&quot;,
        &quot;agent_wrapup_time&quot;:{AGENT_WRAPUP},
        &quot;tick_time&quot;:1000,
        &quot;members&quot;:{
            {MEMBERS_LIST}
        },
        &quot;id&quot;:&quot;{QUEUE_ID}&quot;,
    },
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

The \{MEMBERS\_LIST\} for a queue will consist of a list of key -> value mappings where the key is the id of a Qubicle enabled user (recipient) and the value is an empty string.

Plain Text

<pre tabindex="0"><code>    &quot;members&quot;:{
        &quot;{USER_ID}&quot;:&quot;&quot;,
        &quot;{USER2_ID}&quot;:&quot;&quot;
    }</code></pre>

### Create a queue

This action will allow configuration of a new queue.

PUT /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/

Plain Text

<pre tabindex="0"><code>curl -v -X PUT -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues -d '{&quot;data&quot;:{&quot;name&quot;:&quot;{QUEUE_NAME}&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;name&quot;:&quot;{QUEUE_NAME}&quot;,
        &quot;agent_connect_timeout&quot;:15,
        &quot;agent_wrapup_time&quot;:2,
        &quot;queue_router&quot;:&quot;route_round_robin&quot;,
        &quot;queue_timeout&quot;:3600,
        &quot;queue_type&quot;:&quot;queue_basic&quot;,
        &quot;tick_time&quot;:1000,
        &quot;id&quot;:&quot;{QUEUE_ID}&quot;
    },
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Modify a queue

The queue configuration can be modified with a PATCH request as follows

PATCH /v2/accounts/\{ACCOUNT\_ID\}/qubicle/queues/\{QUEUE\_ID\}

Plain Text

<pre tabindex="0"><code>curl -v -X PATCH -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID} -d '{&quot;data&quot;:{&quot;queue_timeout&quot;:&quot;2000&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;name&quot;:&quot;{QUEUE_NAME}&quot;,
        &quot;agent_connect_timeout&quot;:{AGENT_CONNECT_TIMEOUT},
        &quot;agent_wrapup_time&quot;:{AGENT_WRAPUP_TIME},
        &quot;queue_router&quot;:{QUEUE_ROUTER},
        &quot;queue_timeout&quot;:2000,
        &quot;queue_type&quot;:{QUEUE_TYPE},
        &quot;tick_time&quot;:1000,
        &quot;id&quot;:&quot;{QUEUE_ID}&quot;
    },
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### List queue sessions

This action lists all sessions that are in the queue currently.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}/sessions

curl -v -X GET -H "X-Auth-Token: \{AUTH\_TOKEN\}" http://\{SERVER\}:8000/v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}/sessions
Return Value:

\{
    "data": \[
        \{
            "queue\_id":"\{QUEUE\_ID\}",
            "session\_list": \[\{SESSION1\}, \{SESSION2\}\]
        \}
    \],
    "revision":"\{REVISION\}",
    "request\_id":"\{REQUEST\_ID\}",
    "status":"success",
    "auth\_token":"\{AUTH\_TOKEN\}"
\}

### List queue recipients

This action lists all recipients that are in the queue currently, as well as their permissions.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}/recipients

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/recipients</code></pre>

Return Value:

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;: [
        {
            &quot;id&quot;:{RECIP_1_ID},
            &quot;permission_roles&quot;: {RECIP_1_ROLES},
            &quot;permissions&quot;: [{RECIP_1_PERMISSIONS}]
        }
    ],
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Set the queue membership

This action modifies the membership of a queue.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}/recipients

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/recipients -d '{&quot;data&quot;: {&quot;action&quot;: {ACTION}, &quot;members&quot;:[&quot;{USER_ID_1}&quot;, &quot;{USER_ID_2}&quot;]}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;name&quot;:&quot;{QUEUE_NAME}&quot;,
        &quot;queue_type&quot;:&quot;queue_basic&quot;,
        &quot;queue_router&quot;:&quot;route_round_robin&quot;,
        &quot;timeout&quot;:{TIMEOUT},
        &quot;agent_connect_timeout&quot;:15,
        &quot;hold_treatment&quot;:&quot;{MEDIA_ID}&quot;,
        &quot;agent_wrapup_time&quot;:2,
        &quot;tick_time&quot;:1000,
        &quot;members&quot;:{
            {USER_ID_1}:&quot;&quot;,
            {USER_ID_2}:&quot;&quot;
        },
        &quot;id&quot;:&quot;{QUEUE_ID}&quot;
    },
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

<aside class="note"><p>Members is a list of user id's</p></aside>

Action is one of the following:

<ul>
<li><p>add: adds the list of id's to queue membership</p>
</li>
<li><p>remove: removes the list of id's from queue membership</p>
</li>
<li><p>set: sets the membership to exactly the list of id's provided</p>
</li>
</ul>

### Clear a queue's membership

DELETE /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_queues/\{QUEUE\_ID\}/recipients

Plain Text

<pre tabindex="0"><code>curl -v -X DELETE -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/recipients</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;name&quot;:&quot;{QUEUE_NAME}&quot;,
        &quot;queue_type&quot;:&quot;queue_basic&quot;,
        &quot;queue_router&quot;:&quot;route_round_robin&quot;,
        &quot;timeout&quot;:{TIMEOUT},
        &quot;agent_connect_timeout&quot;:15,
        &quot;hold_treatment&quot;:&quot;{MEDIA_ID}&quot;,
        &quot;agent_wrapup_time&quot;:2,
        &quot;tick_time&quot;:1000,
        &quot;members&quot;:{
        },
        &quot;id&quot;:&quot;{QUEUE_ID}&quot;
    },
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;status&quot;:&quot;success&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

## Qubicle Recipient API

Introduction

This API allows a user to control recipient state as well as get information about recipient state.

### List recipients

This action will return a list of all configured recipients for an account.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;page_size&quot;:2,
    &quot;data&quot;:[
        {&quot;id&quot;:&quot;{RECIPIENT_ID1}&quot;,&quot;name&quot;:&quot;{RECIPIENT_NAME1}&quot;},
        {&quot;id&quot;:&quot;{RECIPIENT_ID2}&quot;,&quot;name&quot;:&quot;{RECIPIENT_NAME2}&quot;}
    ],
    &quot;status&quot;:&quot;success&quot;,
    &quot;revision&quot;:&quot;{REVISION}&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Get recipient configuration

This action will return the recipient configuration of the specified recipient. NOTE this is actually a users document.

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{USER_ID}</code></pre>

The returned document is a VirtualPBX users document

### Get recipient status

Returns the current status of the recipient.

GET /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{USER\_ID\}/status

Plain Text

<pre tabindex="0"><code>curl -v -X GET -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{USER_ID}/status</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;available&quot;: {AVAILABLE},
        &quot;availability_state&quot;: {AVAIL_STATE},
        &quot;queue_availability&quot;: {QUEUE_AVAILABILITY},
        &quot;offered_call&quot;: {OFFERED_CALL_INFO},
        &quot;handling_call&quot;: {HANDLING_CALL_INFO},
        &quot;wiretapping_recipient&quot;: {WIRETAPPING_RECIPIENT_ID},
        &quot;wiretap_mode&quot;: {WIRETAP_MODE},
        &quot;wrapup_time_seconds&quot;: {WRAPUP_TIME_SECONDS},
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        },
        &quot;node&quot;: {RUNNING_ON_NODE}
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

<ul>
<li><p>Available: true or false depending on recipient availability</p>
</li>
<li><p>Avg-Call-Time: the average amount of time the recipient has spent on a call (in seconds)</p>
</li>
<li><p>Login-Time: the unix timestamp of when the recipient logged in</p>
</li>
<li><p>Total-Calls: the total number of calls that the recipient has handled</p>
</li>
<li><p>Missed-Calls: the total number of calls that the recipient failed to handle for any reason</p>
</li>
<li><p>Availability-State: The state of the recipient ( &quot;Ready&quot; | &quot;Away&quot; | &quot;Wrapup-Time&quot; | &quot;Call-Offer&quot; | &quot;On-A-Call&quot; | &quot;Not-Logged-In&quot; )</p>
</li>
<li><p>Queue-Availability: IF a per-queue availability flag(s) have been set, they will be reported here as a list of queue-id -&gt; boolean values</p>
</li>
<li><p>Last-Action-Time: The timestamp of the last time the recipient changed state</p>
</li>
<li><p>Last-Handled-Time: The timestamp of the last time the recipient was delivered a call</p>
</li>
<li><p>Offered-Call: IF there is a call currently being offered, this will contain the Queue-ID, Session-ID, Caller-ID-Name, Caller-ID-Number, Queue-Enter-Time of the * call</p>
</li>
<li><p>Handling-Call: IF there is a call currently being handled, this will contain the Queue-ID, Session-ID, Caller-ID-Name, Caller-ID-Number, Queue-Enter-Time of the * call</p>
</li>
<li><p>Wrapup-Time-Seconds: The time left, in seconds, until the recipient is out of wrapup (0 if they are not on wrap up)</p>
</li>
<li><p>Node: The node that the process for this recipient is running on</p>
</li>
<li><p>Wiretapping-Recipient: IF the recipient is wiretapping another recipient, this will be the id of the target recipient</p>
</li>
<li><p>Wiretap-Mode: IF the recipient is wiretapping another recipient, this will be the mode (whisper, eavesdrop, barge)</p>
</li>
</ul>

### Get recipient list status

Returns the current status of a list of recipients.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/status

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/status -d '{&quot;data&quot;:{&quot;recipient_ids&quot;:[{RECIP_ID_1},{RECIP_ID_2},{RECIP_ID_3}]}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        {RECIP_ID_1}: {
            &quot;available&quot;: {AVAILABLE},
            &quot;availability_state&quot;: {AVAIL_STATE},
            &quot;offered_call&quot;: {OFFERED_CALL_INFO},
            &quot;handling_call&quot;: {HANDLING_CALL_INFO},
            &quot;wrapup_time_seconds&quot;: {WRAPUP_TIME_SECONDS},
            &quot;stats&quot;: {
                &quot;total_calls&quot;: {TOTAL_CALLS},
                &quot;missed_calls&quot;: {MISSED_CALLS},
                &quot;avg_call_time&quot;: {AVG_CALL_TIME},
                &quot;login_time&quot;: {LOGIN_TIME},
                &quot;last_action_time&quot;: {LAST_ACTION_TIME},
                &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
            },
            &quot;node&quot;: {RUNNING_ON_NODE}
        },
        {RECIP_ID_2}: {
            &quot;available&quot;: {AVAILABLE},
            &quot;availability_state&quot;: {AVAIL_STATE},
            &quot;offered_call&quot;: {OFFERED_CALL_INFO},
            &quot;handling_call&quot;: {HANDLING_CALL_INFO},
            &quot;wrapup_time_seconds&quot;: {WRAPUP_TIME_SECONDS},
            &quot;stats&quot;: (
                &quot;total_calls&quot;: {TOTAL_CALLS},
                &quot;missed_calls&quot;: {MISSED_CALLS},
                &quot;avg_call_time&quot;: {AVG_CALL_TIME},
                &quot;login_time&quot;: {LOGIN_TIME},
                &quot;last_action_time&quot;: {LAST_ACTION_TIME},
                &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
            },
            &quot;node&quot;: {RUNNING_ON_NODE}
        },
        {RECIP_ID_3}: &quot;not_logged_in&quot;
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

NOTE This will either return the same object as the /status API for a single recipient, or the value "not\_logged\_in"

### Login recipient

The login action will log a recipient in and start the recipient process.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{RECIPIENT\_ID\}/

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{RECIPIENT_ID} -d '{&quot;data&quot;:{&quot;action&quot;:&quot;login&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;action&quot;:&quot;login&quot;
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Logout recipient

The logout action will terminate the recipient process, and log the recipient out of Qubicle.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{RECIPIENT\_ID\}/

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{RECIPIENT_ID} -d '{&quot;data&quot;:{&quot;action&quot;:&quot;logout&quot;}}':</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;action&quot;:&quot;logout&quot;
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Set recipient status

Sets the recipient's status. The possible status values are login / logout / ready / away. The recipient must be logged in (status set to login) prior to being able to set a ready / away status. The "queue\_id" argument is OPTIONAL and if present will set the availability for that queue only.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{RECIPIENT\_ID\}/status

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{USER_ID}/status -d '{&quot;data&quot;:{&quot;status&quot;:&quot;{STATUS}&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;status&quot;:&quot;{STATUS}&quot;,
        &quot;queue_id&quot;:{QUEUE_ID &lt;OPTIONAL&gt;}
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Extend Wrap-Up Time

The wrapup\_extend action will reset the recipient's wrap up time to the full amount. The amount varies based on the configuration of the queue the previous call was handled from.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{RECIPIENT\_ID\}/

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{RECIPIENT_ID} -d '{&quot;data&quot;:{&quot;action&quot;:&quot;wrapup_extend&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;action&quot;:&quot;wrapup_extend&quot;
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Cancel Wrap-Up Time

The wrapup\_cancel action will end the recipients current wrapup time.

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{RECIPIENT\_ID\}/

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{RECIPIENT_ID} -d '{&quot;data&quot;:{&quot;action&quot;:&quot;wrapup_cancel&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;action&quot;:&quot;wrapup_cancel&quot;
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

### Monitor Recipient

Pro only feature
The monitor action will eavesdrop another recipient (if the current recipient has the permission enabled, and you are using Callcenter Pro)

The possible mode values are:

<ul>
<li><p>&quot;eavesdrop&quot;: the monitoring recipient can hear both the caller and agent (this is the default mode)</p>
</li>
<li><p>&quot;whisper&quot;: the monitoring recipient can talk to the agent only, but hear both parties</p>
</li>
<li><p>&quot;barge&quot;: the monitoring recipient is in a 3 way call with the agent and caller</p>
</li>
</ul>

POST /v2/accounts/\{ACCOUNT\_ID\}/qubicle\_recipients/\{RECIPIENT\_ID\}/

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{RECIPIENT_ID} -d '{&quot;data&quot;:{&quot;action&quot;:&quot;monitor&quot;, &quot;target&quot;: {TARGET_RECIPIENT_ID}, &quot;mode&quot;: {MODE}}'</code></pre>

Plain Text

<pre tabindex="0"><code>{
    &quot;data&quot;:{
        &quot;action&quot;:&quot;monitor&quot;
    },
    &quot;status&quot;:&quot;success&quot;,
    &quot;request_id&quot;:&quot;{REQUEST_ID}&quot;,
    &quot;auth_token&quot;:&quot;{AUTH_TOKEN}&quot;
}</code></pre>

## Router Types

The following is a description of the types of routers that are available to be used for Qubicle queues, and the method that they use to distribute sessions. These routing methods (with the exception of round robin) are all simple hard routing metrics. This means that based on the type they will all have potential caveats that would allow a recipient or recipients to get into a state where the routing metrics are skewed and could cause delivery issues (or the appearance of issues). This must be taken into account when choosing a routing method.

### Round Robin

### Configuration

Plain Text

<pre tabindex="0"><code>&quot;queue_router&quot;: &quot;route_round_robin&quot;</code></pre>

### Description

Round robin will evenly distribute calls amongst the membership of a queue. The routing algorithm will start a "round" that contains all members of the queue, and then for each session will offer a member an available session. When a member receives an offer, they are removed from the current "round" and will not be considered for delivery of an additional offer until everyone in the round has been offered a call. Note that the outcome of the offer to a member does not factor into their removal from the current round.

Caveats
none

### Least Calls

### Configuration

Plain Text

<pre tabindex="0"><code>&quot;queue_router&quot;: &quot;route_least_calls&quot;</code></pre>

### Description

Least calls will take all members of a queue and sort the list by the number of calls that they have handled. Sessions will then be distributed in order starting with the member that has the least calls.

Caveats
You must take into account that this routes according to HANDLED calls. Therefore if a recipient has the least number of handled calls and is offered a session but continues to reject that session they will still be offered the session until they either handle it, or it times out.

### Least Offers

### Configuration

Plain Text

<pre tabindex="0"><code>&quot;queue_router&quot;: &quot;route_least_offers&quot;</code></pre>

### Description

Least offers will take all members of a queue and sort the list by the number of sessions that they have been offered. Sessions will then be distributed in order starting with the member that has the least offers.

### Caveats

You must take into account that this routes according to OFFERS of sessions. If you have a recipient that is continually rejecting offers, or has stepped away and not correctly set their state to 'away' (therefore they are being offered sessions that will be rejected ultimately) then the routing metrics for that recipient will be skewed. They may then spend a long amount of time without being offered a session since their offered count will be much higher than recipients that are not repeatedly rejecting offers.

### Most Idle

### Configuration

Plain Text

<pre tabindex="0"><code>&quot;queue_router&quot;: &quot;route_most_idle&quot;</code></pre>

### Description

Most idle routing will sort the recipients by the time that they last handled a call, and route sessions to those with the longest time elapsed since they have handled a call.

### Caveats

As with other hard metric routing methods, there is the potential for undesirable behavior if a recipient skews the metrics and incorrectly sets their state. This must be taken into account when choosing a routing algorithm.

## BLF Status Indication Guide

This guide will provide an overview of setting up BLF to report the status of a Qubicle recipient.

### Prerequisites

A valid user that has a device configured, and is enabled as a Qubicle recipient

### Configuration

In order to enable BLF indications for a recipient, we must first configure the 'presence\_id' that we wish to use on the recipient. This can be achieved with the following Crossbar request:

NOTE this is using the users API.

Plain Text

<pre tabindex="0"><code>curl -X PATCH -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; http://{SERVER}:8000/v1/accounts/{ACCOUNT_ID}/users/{RECIPIENT_ID}/ -d '{&quot;data&quot;:{&quot;qubicle&quot;:{&quot;presence_id&quot;:&quot;{PRESENCE_ID}&quot;}}}'</code></pre>

### Phone Configuration

Phone configuration will vary by the model of phone / sip device you are using. However you can now configure your device to subscribe to \{PRESENCE\_ID\}@\{REALM\} and you will be provided with BLF updates when the state of the recipient changes.

### States

The BLF states correspond to the following recipient states:

<ul>
<li><p>IDLE: logged out</p>
</li>
<li><p>RINGING: logged in, but away</p>
</li>
<li><p>ON-A-CALL: logged in, ready</p>
</li>
</ul>

## Using Qubicle as a Recipient via Callflows

This guide will provide an overview of interaction with Qubicle as a recipient, using Callflows.

This will mean that you are going to be set up as an agent that will receive calls from a queue, and you will login and logout of that queue via feature codes from your phone.

### Prerequisites

A valid user that has a device configured, and is enabled as a Qubicle recipient

### References

In this guide we will be using the following schemas and APIs:

cf\_quibcle\_recipient

### Setup

In this example we will assume that our agents are using their own desk phones, thus we can enable device linking when using the recipient callflow so that they do not need to remember a pin code. The first step in this process is to decide which feature codes we would like to correspond to the various actions, and then configure the callflows for them.

Let us assume that for the purposes of this example we will use the following feature codes:

<ul>
<li><p>20 to login</p>
</li>
<li><p>21 to set ready state</p>
</li>
<li><p>22 to set away state</p>
</li>
<li><p>23 to logout</p>
</li>
</ul>

Now that we have decided the method for linking the calls to recipients and the feature codes we wish to use, we can proceed with the configuration via Crossbar APIs.

### Configure login callflow

Plain Text

<pre tabindex="0"><code>curl -X PUT -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; http://{SERVER}:8000/v1/accounts/{ACCOUNT_ID}/callflows -d '{&quot;data&quot;:{&quot;flow&quot;:{&quot;module&quot;:&quot;qubicle_recipient&quot;,&quot;data&quot;:{&quot;link_method&quot;:&quot;device&quot;,&quot;action&quot;:&quot;login&quot;}},&quot;featurecode&quot;:{&quot;name&quot;:&quot;qubicle login&quot;,&quot;number&quot;:&quot;20&quot;},&quot;numbers&quot;:[&quot;*20&quot;]}}'</code></pre>

### Configure set ready callflow

Plain Text

<pre tabindex="0"><code>curl -X PUT -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; http://{SERVER}:8000/v1/accounts/{ACCOUNT_ID}/callflows -d '{&quot;data&quot;:{&quot;flow&quot;:{&quot;module&quot;:&quot;qubicle_recipient&quot;,&quot;data&quot;:{&quot;link_method&quot;:&quot;device&quot;,&quot;action&quot;:&quot;ready&quot;}},&quot;featurecode&quot;:{&quot;name&quot;:&quot;qubicle set ready&quot;,&quot;number&quot;:&quot;21&quot;},&quot;numbers&quot;:[&quot;*21&quot;]}}'</code></pre>

### Configure set away callflow

Plain Text

<pre tabindex="0"><code>curl -X PUT -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; http://{SERVER}:8000/v1/accounts/{ACCOUNT_ID}/callflows -d '{&quot;data&quot;:{&quot;flow&quot;:{&quot;module&quot;:&quot;qubicle_recipient&quot;,&quot;data&quot;:{&quot;link_method&quot;:&quot;device&quot;,&quot;action&quot;:&quot;away&quot;}},&quot;featurecode&quot;:{&quot;name&quot;:&quot;qubicle set away&quot;,&quot;number&quot;:&quot;22&quot;},&quot;numbers&quot;:[&quot;*22&quot;]}}'</code></pre>

### Configure logout callflow

Plain Text

<pre tabindex="0"><code>curl -X PUT -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; http://{SERVER}:8000/v1/accounts/{ACCOUNT_ID}/callflows -d '{&quot;data&quot;:{&quot;flow&quot;:{&quot;module&quot;:&quot;qubicle_recipient&quot;,&quot;data&quot;:{&quot;link_method&quot;:&quot;device&quot;,&quot;action&quot;:&quot;logout&quot;}},&quot;featurecode&quot;:{&quot;name&quot;:&quot;qubicle logout&quot;,&quot;number&quot;:&quot;23&quot;},&quot;numbers&quot;:[&quot;*23&quot;]}}'</code></pre>

### Typical Use

Now let's walk through the typical usage from the viewpoint of a call center agent. First the agent will arrive at their desk and log into the queue, to indicate that they are now on shift and working.

<ul>
<li><p>* Agent dials 20 on their desk phone *</p>
Perhaps the agent then gets some coffee, reads some emails, and is now ready to take calls. The agent then goes into the 'ready' state, so that they are marked as available to take calls.</li>
<li><p>* Agent dials 21 on their desk phone *</p>
After a few hours it is time to go on break, the agent will now mark themselves as 'away' so that they are no longer considered available for call delivery.</li>
<li><p>* Agent dials 22 on their desk phone *</p>
The agent will then enjoy lunch and upon returning, set themselves as ready again to finish out their shift.</li>
<li><p>* Agent dials 21 on their desk phone *</p>
After a long days work, the agent is ready to go home. They will log out of Qubicle signifying the end of their shift.</li>
<li><p>* Agent dials 23 on their desk phone *</p>
</li>
</ul>

## Qubicle User Guide

This guide will provide an overview of interaction with the Qubicle system from the viewpoint of a recipient (agent).

### Prerequisites

A valid user that has a device configured, and is enabled as a Qubicle recipient

### Recipient States

A recipient can be in one of three states at any given time. Not logged in, Logged in but 'away', and Logged in and 'ready'. In order for a recipient to be considered for routing a call they must be both logged in, and in the ready state.

### Managing state

Login state is managed for a recipient by using the Recipient Crossbar API. More specifically the "Set recipient status" method. Setting the recipients status value to 'login' will initiate the login process for that recipient, setting it to 'logout' will log out and terminate the process for the recipient.

Ready and away state are also managed using the same API call, with either the status being 'ready' or 'away'.

### A quick example

So in order for you as a recipient to log in and take a call, you would need to perform the following two API calls to set yourself as logged in and ready:

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{USER_ID}/status -d '{&quot;data&quot;:{&quot;status&quot;:&quot;login&quot;}}'</code></pre>

Plain Text

<pre tabindex="0"><code>curl -v -X POST -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; -H &quot;Content-Type: application/json&quot; http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_recipients/{USER_ID}/status -d '{&quot;data&quot;:{&quot;status&quot;:&quot;ready&quot;}}'</code></pre>

## Qubicle Websockets Setup

### Introduction

This document will get a basic Websockets connection set up to the Qubicle event feed.

### Prerequisites

In order for the Websocket connections to work correctly, the Blackhole application must be started and the bh\_qubicle module must be present and loaded.

### Initiate Websocket connection

Set up the Websocket connection to Blackhole

Plain Text

<pre tabindex="0"><code>var ws = new WebSocket(&quot;ws://{SERVER}:5555&quot;);
// Connection Open Callback
ws.onopen = function() {
    console.log(&quot;Websocket connection is open.&quot;);
}</code></pre>

### Subscribe to Qubicle events via Websocket

Once the connection is successfully opened you must use a valid auth token to subscribe to Qubicle events. In this example a convenience function is created to help with the JSON formatting.

Plain Text

<pre tabindex="0"><code>// Log Websocket data to console
ws.onmessage = function(ws_data) {
    var msg = JSON.parse(ws_data.data);
    console.log(ws_data.data);
}
function send(json) {
    ws.send(JSON.stringify(json));
}
// Subscribe for session events
send({&quot;action&quot;:&quot;subscribe&quot;, &quot;auth_token&quot;: &quot;{AUTH_TOKEN}&quot;, &quot;data&quot;:{&quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;, &quot;binding&quot;: &quot;qubicle.session&quot;}});
// Subscribe for recipient events
send({&quot;action&quot;:&quot;subscribe&quot;, &quot;auth_token&quot;: &quot;{AUTH_TOKEN}&quot;, &quot;data&quot;:{&quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;, &quot;binding&quot;: &quot;qubicle.recipient&quot;}});
// Subscribe for queue events
send({&quot;action&quot;:&quot;subscribe&quot;, &quot;auth_token&quot;: &quot;{AUTH_TOKEN}&quot;, &quot;data&quot;:{&quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;, &quot;binding&quot;: &quot;qubicle.queue&quot;}});</code></pre>

## Queue Events

### Create

The create event indicates that a queue has started running.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.queue&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;create&quot;,
    &quot;routing_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.{QUEUE_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-queue&quot;,
        &quot;event_name&quot;: &quot;create&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;pid&quot;: &quot;{PROCESS_PID}&quot;,
        &quot;stats&quot;: {
            &quot;estimated_wait&quot;: {EST_WAIT_TIME},
            &quot;average_wait&quot;: {AVG_WAIT_TIME},
            &quot;recipient_count&quot;: {RECIPIENT_COUNT},
            &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
            &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
            &quot;missed_sessions&quot;: {MISSED_COUNT},
            &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
        }
    }
}</code></pre>

### Delete

The delete event indicates that a queue is no longer running.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.queue&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;delete&quot;,
    &quot;routing_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.{QUEUE_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-queue&quot;,
        &quot;event_name&quot;: &quot;delete&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;reason&quot;: &quot;{REASON}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;stats&quot;: {
            &quot;estimated_wait&quot;: {EST_WAIT_TIME},
            &quot;average_wait&quot;: {AVG_WAIT_TIME},
            &quot;recipient_count&quot;: {RECIPIENT_COUNT},
            &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
            &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
            &quot;missed_sessions&quot;: {MISSED_COUNT},
            &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
        }
    }
}</code></pre>

### Sync

The sync event periodically updates clients to ensure that they have the correct and latest queue information.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.queue&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;sync&quot;,
    &quot;routing_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.{QUEUE_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-queue&quot;,
        &quot;event_name&quot;: &quot;sync&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;stats&quot;: {
            &quot;estimated_wait&quot;: {EST_WAIT_TIME},
            &quot;average_wait&quot;: {AVG_WAIT_TIME},
            &quot;recipient_count&quot;: {RECIPIENT_COUNT},
            &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
            &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
            &quot;missed_sessions&quot;: {MISSED_COUNT},
            &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
        }
    }
}</code></pre>

### Join

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.queue&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;join&quot;,
    &quot;routing_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.{QUEUE_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-queue&quot;,
        &quot;event_name&quot;: &quot;join&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;join_time&quot;: {JOIN_TIME},
        &quot;join_position&quot;: {JOIN_POSITION},
        &quot;est_wait_time&quot;: {ESTIMATED_WAIT_TIME},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;stats&quot;: {
            &quot;estimated_wait&quot;: {EST_WAIT_TIME},
            &quot;average_wait&quot;: {AVG_WAIT_TIME},
            &quot;recipient_count&quot;: {RECIPIENT_COUNT},
            &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
            &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
            &quot;missed_sessions&quot;: {MISSED_COUNT},
            &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
        }
    }
}</code></pre>

### Leave

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.queue&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;leave&quot;,
    &quot;routing_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.{QUEUE_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-queue&quot;,
        &quot;event_name&quot;: &quot;leave&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;reason&quot;: &quot;{REASON}&quot;,
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;total_wait_time&quot;: {TOTAL_WAIT_TIME},
        &quot;stats&quot;: {
            &quot;estimated_wait&quot;: {EST_WAIT_TIME},
            &quot;average_wait&quot;: {AVG_WAIT_TIME},
            &quot;recipient_count&quot;: {RECIPIENT_COUNT},
            &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
            &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
            &quot;missed_sessions&quot;: {MISSED_COUNT},
            &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
        }
    }
}</code></pre>

### Delivered

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.queue&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;delivered&quot;,
    &quot;routing_key&quot;:&quot;qubicle.queue.{ACCOUNT_ID}.{QUEUE_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-queue&quot;,
        &quot;event_name&quot;: &quot;delivered&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;total_wait_time&quot;: {TOTAL_WAIT_TIME},
        &quot;stats&quot;: {
            &quot;estimated_wait&quot;: {EST_WAIT_TIME},
            &quot;average_wait&quot;: {AVG_WAIT_TIME},
            &quot;recipient_count&quot;: {RECIPIENT_COUNT},
            &quot;active_session_count&quot;: {ACTIVE_SESSION_COUNT},
            &quot;total_sessions&quot;: {TOTAL_SESSION_COUNT},
            &quot;missed_sessions&quot;: {MISSED_COUNT},
            &quot;abandoned_sessions&quot;: {ABANDONED_COUNT}
        }
    }
}</code></pre>

## Recipient Events

Recipient events can be used to track the state and actions that affect a recipient in Qubicle. The following are the currently emitted events.

### Login

The login event is emitted when a recipient logs into Qubicle via any means.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;create&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;create&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;pid&quot;: &quot;{PROCESS_PID}&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;state&quot;: &quot;away&quot;,
        &quot;username&quot;: &quot;{USERNAME}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Logout

The logout event is emitted when a recipient logs out of Qubicle via any means.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;delete&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;delete&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;reason&quot;: &quot;{REASON}&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Ready

The ready event indicates that a recipient is now is the 'ready' state, and thus can receive sessions from a queue.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;ready&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;away_time&quot;: {TIME_RECIPIENT_WAS_AWAY_IN_SECONDS}
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;ready&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;state&quot;: &quot;ready&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Away

The away event indicates that a recipient is in the 'away' state and thus will not be considered for session delivery from a queue.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;away&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;away&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;state&quot;: &quot;away&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;reason&quot;: &quot;{REASON}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Pause

The pause event indicates that a recipient has paused call delivery from a given queue.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;pause&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;pause&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Resume

The resume event indicates that a recipient has resumed call delivery from a given queue.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;resume&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;resume&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Wrapup Start

The wrapup start event indicates the start of wrap-up time. Which is a configurable (per-queue) amount of time after handling a session that the recipient will not be offered additional sessions.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;wrapup_start&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;wrapup-start&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;state&quot;: {STATE},
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;wrapup_time_seconds&quot;: {TIME_IN_SECONDS_OF_WRAPUP},
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Wrapup Complete

The wrapup complete event indicates the end of wrap-up time.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;wrapup_complete&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;available&quot;: {BOOLEAN IF AVAILABLE},
        &quot;availability_state&quot;: &quot;{STRING_AVAIL_STATE}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;wrapup-complete&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;state&quot;: {STATE},
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;total_time&quot;: {TOTAL_WRAPUP_TIME},
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Offer

The offer event indicates that a session is being offered to the recipient from a queue.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;offer&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;caller_id_name&quot;: &quot;{CALLER_ID_NAME}&quot;,
        &quot;caller_id_num&quot;: &quot;{CALLER_ID_NUM}&quot;,
        &quot;enter_pos&quot;: {QUEUE_ENTER_POSITION},
        &quot;queue_enter_time&quot;: {QUEUE_ENTER_TIME},
        &quot;est_wait&quot;: {QUEUE_ESTIMATED_WAIT},
        &quot;force_away_on_reject&quot;: {FORCE_AWAY_FLAG},
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;offer&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;queue_wrapup&quot;: {QUEUE_WRAPUP_TIME},
        &quot;recipient_id&quot;: &quot;{USER_ID}&quot;,
        &quot;ring_timeout&quot;: {RING_TIMEOUT},
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;session_zone&quot;: &quot;{SESSION_ZONE}&quot;,
        &quot;caller_id_name&quot;: {CALLER_ID_NAME},
        &quot;caller_id_number&quot;: {CALLER_ID_NUMBER},
        &quot;queue_enter_time&quot;: {QUEUE_ENTER_TIME},
        &quot;state&quot;: &quot;{STATE}&quot;,
        &quot;offer_data&quot;: {PRIV_OFFER_DATA},
        &quot;session&quot;: {SESSION_CALL_OBJECT},
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Reject

The reject event indicates that a recipient has rejected a call.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;reject&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;reject&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Rescind

The rescind event indicates that an offer has been rescinded from the recipient. This could happen for example if a session hung-up while it was being offered.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;rescind&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;state&quot;:&quot;{STATE}&quot;,
        &quot;session_id&quot;:&quot;{SESSION_ID}&quot;,
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;rescind&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Delivered

The delivered event indicates that a session was successfully delivered to a recipient and is now being handled.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;delivered&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-recipient&quot;,
        &quot;event_name&quot;: &quot;delivered&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;recipient_id&quot;: &quot;{RECIPIENT_ID}&quot;,
        &quot;queue_id&quot;: &quot;{QUEUE_ID}&quot;,
        &quot;queue_name&quot;: &quot;{QUEUE_NAME}&quot;,
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;caller_id_name&quot;: {CALLER_ID_NAME},
        &quot;caller_id_number&quot;: {CALLER_ID_NUMBER},
        &quot;queue_enter_time&quot;: {QUEUE_ENTER_TIME},
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Hangup

The hangup event indicates that a session has been hung-up after being handled by the recipient.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;hangup&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;queue_id&quot;:&quot;{QUEUE_ID}&quot;,
        &quot;session_id&quot;:&quot;{SESSION_ID}&quot;,
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;hangup&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;talk_time&quot;: {TALK_TIME},
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### External Call Start

The external call start message indicates that a recipient has gone on a non-queue call.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;external_call_start&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;external_call_start&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;external_call_id&quot;: &quot;{CALL_ID}&quot;,
        &quot;state&quot;: &quot;{STATE}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### External Call End

The external call end event indicates that a recipient is no longer on a non-queue call.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;external_call_end&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;external_call_end&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;state&quot;: &quot;{STATE}&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Sync

The sync event is used to periodically propagate the state of a recipient so that clients can ensure that they have the most up-to-date state information. This event is used for internal purposes, and as such may change at any time.

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;sync&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;sync&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;availability_state&quot;: &quot;{AVAILABILITY_STATE}&quot;,
        &quot;available&quot;: {AVAILABLE_FLAG},
        &quot;node&quot;: &quot;{ORIGINATING_NODE}&quot;,
        &quot;wrapup_time_seconds&quot;: {SECONDS_OF_WRAPUP},
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Wiretap Start

The wiretap start event indicates that the recipient is wiretapping / monitoring another recipient, or is being monitored

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;wiretap_start&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;monitoring-recipient-id&quot;: &quot;{MONITORING_RECIPIENT_ID}&quot;,
        &quot;target&quot;: &quot;{TARGET_RECIPIENT_ID}&quot;,
        &quot;mode:&quot; &quot;{WIRETAP_MODE}&quot;,
        &quot;wiretap-call-id&quot;: &quot;{WIRETAP_CALL_ID}&quot;,
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;wiretap_start&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Wiretap Stop

The wiretap stop event indicates that the recipient is no longer monitoring or being monitored

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;wiretap_stop&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;wiretap-call-id&quot;: &quot;{WIRETAP_CALL_ID}&quot;,
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;wiretap_stop&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

### Wiretap Failed

The wiretap failed event indicates that an attempted monitor action has failed for some reason

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.recipient&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;wiretap_failed&quot;,
    &quot;routing_key&quot;:&quot;qubicle.recipient.{ACCOUNT_ID}.{RECIPIENT_ID}&quot;,
    &quot;data&quot;:{
        &quot;recipient_id&quot;:&quot;{RECIPIENT_ID}&quot;,
        &quot;account_id&quot;:&quot;{ACCOUNT_ID}&quot;,
        &quot;msg_id&quot;:&quot;{MSG_ID}&quot;,
        &quot;event_name&quot;:&quot;wiretap_failed&quot;,
        &quot;event_category&quot;:&quot;qubicle-recipient&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP},
        &quot;app_version&quot;:&quot;{VERSION}&quot;,
        &quot;app_name&quot;:&quot;qubicle&quot;,
        &quot;stats&quot;: {
            &quot;total_calls&quot;: {TOTAL_CALLS},
            &quot;offered_calls&quot;: {OFFERED_CALLS},
            &quot;missed_calls&quot;: {MISSED_CALLS},
            &quot;avg_call_time&quot;: {AVG_CALL_TIME},
            &quot;login_time&quot;: {LOGIN_TIME},
            &quot;last_action_time&quot;: {LAST_ACTION_TIME},
            &quot;last_handled_time&quot;: {LAST_HANDLED_TIME}
        }
    }
}</code></pre>

## Session Events

Create

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.session&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.session.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;create&quot;,
    &quot;routing_key&quot;:&quot;qubicle.session.{ACCOUNT_ID}.{SESSION_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-session&quot;,
        &quot;event_name&quot;: &quot;create&quot;,
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;node&quot;: &quot;VirtualPBX_apps@{SERVER}&quot;,
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;session_type&quot;: &quot;call_session&quot;,
        &quot;caller_id_name&quot;: {CALLER_ID_NAME},
        &quot;caller_id_number&quot;: {CALLER_ID_NUMBER},
        &quot;pid&quot;: {SESSION_PROC_PID},
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP}
    }
}</code></pre>

### Delete

Plain Text

<pre tabindex="0"><code>{
    &quot;action&quot;:&quot;event&quot;,
    &quot;subscribed_key&quot;:&quot;qubicle.session&quot;,
    &quot;subscription_key&quot;:&quot;qubicle.session.{ACCOUNT_ID}.*&quot;,
    &quot;name&quot;:&quot;delete&quot;,
    &quot;routing_key&quot;:&quot;qubicle.session.{ACCOUNT_ID}.{SESSION_ID}&quot;,
    &quot;data&quot;:{
        &quot;account_id&quot;: &quot;{ACCOUNT_ID}&quot;,
        &quot;app_name&quot;: &quot;qubicle&quot;,
        &quot;app_version&quot;: &quot;{VERSION}&quot;,
        &quot;event_category&quot;: &quot;qubicle-session&quot;,
        &quot;event_name&quot;: &quot;delete&quot;,
        &quot;msg_id&quot;: &quot;{MSG_ID}&quot;,
        &quot;node&quot;: &quot;VirtualPBX_apps@{SERVER}&quot;,
        &quot;reason&quot;: &quot;{REASON}&quot;,
        &quot;session_id&quot;: &quot;{SESSION_ID}&quot;,
        &quot;event_timestamp&quot;: {SERVER_TIMESTAMP}
    }
}</code></pre>
