CX Events and Activity Types
This document explains the different events exposed by CIM along with the event type and payload.
What is an Event?
CIMEvent
A CIMEvent is defined as the smallest amount of valuable information representing change of state in the publishing application resource, where:
- A Resource is an object managed by an application. CIM is agnostic of resources.
- Valuable information - An information is valuable if it may be of interest for CIMEvent subscribers.
- An application is a 3rd application that uses CIM for storing and publishing events to other applications of interest. Any type and number of applications may register with CIM for publishing, subscribing, and reporting of events.
A CIMEvent Subscriber may use CIMEvents for:
Audit trail | |
Analytics | Agent performance, customer journey tracking, |
Monitoring | Service Levels, Customer Channels, Bot performance |
Customer Interaction | Consolidate interesting events into Activities for agent serving customers |
Agent Productivity | Capture agent actions for optimising workforce |
Bot Retraining | Use CIM data to retrain bot via Supervised/semi-supervised learning |
See also:
- Google implemented Cloud pub/sub for a similar purpose at a global scale.
- Google Pub/Sub vs Kafka - a very good read about benefits of Kafka and the value it can deliver - good comparison with Amazon services as well
- While Kafka is a strong contender, there're other interesting players to look at such as Apache Pulsar
Stateful | When it's important to monitor and keep track of the state of a session |
---|---|
Interactive | When a session cannot last if any of the participants leave the session. |
ChannelSessions are always stateful. They may or may not be interactive. For example, a call is an interactive session and the chat is a non-interactive session.
Activities are always stateless. With this definition, an activity is the change of state in any system domain / conversation that the system considers as a considerable change of state.
An Activity is a CIMEvent.
Event Types
CIM Event | A change in state, an action performed by an actor that CIM needs to keep track of such as:
that CIM needs to keep track of. |
---|---|
CTI Event | |
A call leg is an activity and the call is a session.
3rd party voice call scenario
See the finalized flow of Voice call events and related use cases in Mapping CTI events on CIM.
Actors
Agent | |
---|---|
Customer | |
Bot | |
App |
Activity
An activity is formed based an actions performed by actors. An activity may be updated based on reactions, modify-activity events, and delivery notifications. Examples:
- a customer message
- REACTION bot-suggestion is a reaction to the customer message
- MODIFY-ACTIVITY edit/delete-message-event - the customer chose to change or delete the message
- DELIVERY-NOTIFICATION when the agent has read the message. The agent-manager will send this delivery-notification.
- an agent message
- DELIVERY-NOTIFICATION received message delivery notifications
- REACTION customer's reactions to the message in the form of an emoji
- REACTION supervisor's reaction to flag the response as rude, inappropriate, misleading, excellent - based on defined custom flags
- a bot message
- DELIVERY-NOTIFICATION received message delivery notifications
- REACTION customer's reactions to the message in the form of an emoji
- REACTION Bot trainer's reaction to flag a response as inappropriate - based on defined custom flags
- a structured message sent by the bot or the agent - selected from bug suggestions
- REACTION one ore more customer responses to the structured message
- a campaign message - the campaign manager sent an outbound campaign message
- DELIVERY-NOTIFICATION received message delivery notifications
- REACTION customer's reactions to the message in the form of flags - acknowledged / inappropriate / annoying
- an IVR activity - the IVR application sent an activity for an ongoing call.
- an agent call leg - a call leg of a voice call handled by an agent
- a call recording link received - the call recording application sent a call recording link for a recently completed call. The event must have a call id.
- a note - A note sent by an actor - this may or may not have a reference to a channelSession or a conversation ID.
- wrap-up - a wrap-up activity performed by the agent on a conversation / session. The event must have the session or a conversation identifier.
- a survey question - the campaign manager sent a survey question as a structured message
- REACTION customer's response to the survey question
During ongoing phone call, we want to continuously be able to forward speech files to an ASR/ NLU/ Conversation engine to provide services similar to Cisco Answer Services (aka Google Contact center AI). I would then assume that when the ASR engine detects silence/ end of a sentence, The marker information (start/ end time of a sentence) then becomes an activity that can then be run through the pipeline.
Identify Session-based or Session-less Activities
In this table, different activity persistence use cases are analyzed from the perspective of channelSession and conversation. The objective is to analyze the need to:
- open or link a conversation
- open on link a channelSession
Some use cases about scheduler are mentioned on Scheduled Activities.
Use case | ChannelSession | Conversation | |
---|---|---|---|
RecordingSolution sent a voice call recording link | This is a session based activity where the completed call (call-id) is the session identifier. | REQUIRED | NOT-REQUIRED |
ASR sent a speech-to-text sentence |
This is a session based activity where the ongoing voice call-id is a session identifier. | REQUIRED | NOT-REQUIRED |
Add conversation data | As a 3rd party app, if I add a new conversation data key-value pair, this should be stored as an activity as well. | NOT-REQUIRED | REQUIRED |
Update conversation data | As a 3rd party app, if I update an existing conversation data key-value pair, this should be stored an activity as well. | NOT-REQUIRED | REQUIRED |
Channel Session Events
CHANNEL_SESSION_STARTED | This event is fired when a new channel session is provisioned on the Channel Manager. Upon receiving this event, following components should take actions as described:
| ||||||||
System Events
For the events Communicated over JMS:
- JMS Message: CimEvent object (Json format of this object is presented below)
- JMS Type: CIM-Event-Name (e.g. "CHANNEL_SESSION_STARTED")
CimEvent object
{
"id": "<UUID>",
"name": "<String/Enum>",
"type": "<String/Enum>",
"timeStamp": "<TimeStamp>",
"data": "<Any object/payload that needs to be sent with the event>"
}
The following table presents the list of CIM events. Most of these events are communicated over JMS. Few events are communicated over REST APIs.
- For JMS events: the "payload" field is the same as the "data" field in the CimEvent object presented above.
- For REST events: the "payload" field represents the REST API request-body.
Event Types
Type | Description |
---|---|
ACTIVITY | An event is considered of type activity if it carries primary action performed by the actors such as customer, agent, bot or a third-party app. For example, all customer, agent and bot messages are encapsulated in events of type ACTIVITY. |
SUGGESTION | Ideally it should be merged with message (@a user to confirm). This type carries all events of type bot suggestions. |
MESSAGE | This event type carries internal communication . All internal and whisper communication among agents and bots. |
NOTIFICATION | This event type carries all system notifications including REACTIONS or MODIFY EVENT or DELIVERY NOTIFICATION |
Conversation Events
Event name | Who Fires and When | Event Payload | Conversation-Manager | Channel-Manager | Bot-Framework | Agent-Manager | Default Controller Behaviour |
---|---|---|---|---|---|---|---|
CUSTOMER_MESSAGE CONVERSATION_EVENT ACTIVITY | ChannelManager fires it on receiving a message from its Channel Connector. | Publisher | Consumer. Cache this event in Redis. <also explain bot behaviour or agent will behave> | Consumer Send this event to the unified agent over the socket. |
| ||
AGENT_MESSAGE JMS ACTIVITY | AgentManager fires it on receiving a message from the agent. | CIMMessage | Consumer | Consumer | Publisher |
| |
BOT_MESSAGE JMS ACTIVITY | BotFramework fires | CIMMessage | Consumer | Publisher | Consumer |
| |
BOT_SUGGESTION JMS SUGGESTION | BotFramework fires | SuggestionMessage | NA | Publisher | Consumer | Ignore | |
WHISPER_MESSAGE JMS MESSAGE | AgentManager fires | CimMessage Object | NA | NA | NA | Publisher | Does Nothing |
CHANNEL_SESSION_STARTED JMS NOTIFICATION | Channel Manager fires | Publisher | Consumer | NA |
| ||
CHANNEL_SESSION_ENDED JMS NOTIFICATION | Channel Manager fires - confirm which other interfaces fire this event
| Consumer |
| ||||
CHANNEL_SESSION_EXPIRED JMS NOTIFICATION | Channel Manager fires - confirm which other interfaces fire this event | ChannelSession | Publisher |
| |||
AGENT_RESERVED REST NOTIFICATION | Event payload
JS
| NA | Consumer | NA |
| ||
EWT_MESSAGE FUTURE JMS ACTIVITY | - | ||||||
AGENT_SUBSCRIBED JMS NOTIFICATION | Event payload
JS
| Consumer | Publisher |
| |||
AGENT_UNSUBSCRIBED JMS NOTIFICATION | Event payload
JS
| Consumer | Publisher |
| |||
AGENT_RESPONSE_TIMEOUT JMS NOTIFICATION | When the agent response SLA is expired | - | |||||
BOT_TIMEOUT JMS NOTIFICATION | BotFramework fires this if and when the bot doesn't respond timely in response to a customer message. | String | Publisher | - | |||
BOT_NOT_AVAILABLE JMS NOTIFICATION | not implemented yet | - | |||||
CUSTOMER_RESPONSE_TIMEOUT JMS NOTIFICATION | - | ||||||
TOPIC_STATE_CHANGED JMS NOTIFICATION | CustomerTopic | Publisher | - | ||||
ASSOCIATED_CUSTOMER_CHANGED JMS NOTIFICATION | - | ||||||
MESSAGE_DELIVERY_NOTIFICATION JMS NOTIFICATION | - | ||||||
WRAPUP_APPLIED ? JMS ACTIVITY | - | ||||||
ACCEPT_TIMEOUT JMS NOTIFICATION | - | ||||||
TASK_STATE_CHANGED JMS NOTIFICATION | TaskDto | Does Nothing | |||||
REVOKE_RESOURCE JMS NOTIFICATION | Event payload
JS
| NA | Publisher | Consumer | Does Nothing | ||
CONVERSATION_DATA_CHANGED JMS NOTIFICATION | Map<String, String> ... (any Key-value pairs) | Publisher | Does Nothing | ||||
PARTICIPANT_ROLE_CHANGED JMS NOTIFICATION | Event Payload
JS
| Publisher | Consumer | Consumer | Does Nothing | ||
NO_AGENT_AVAILABLE REST NOTIFICATION | NA | Consumer | NA |
| |||
{ "topicId": "<String>" } | |||||||
ACTION_MESSAGE JMS MESSAGE | CimMessage Object | Consumer | NA | Publisher | NA |
| |
CALL_LEG_ENDED JMS ACTIVITY | CIMMessage | NA | Consumer | NA | - | ||
AGENT_OUTBOUND JMS ACTIVITY |
| ||||||
TASK_ENQUEUED JMS ACTIVITY |
| ||||||
MESSAGE_DELIVERY_NOTIFICATION JMS NOTIFICATION | Agent_manager fires it when the agent has read the customer message | CIMMessage | Consumer | Publisher | |||
THIRD_PARTY_ACTIVITY JMS NOTIFICATION | CIMMessage | Producer | Consumer | Consumer | |||
CHANNEL_SESSION_DATA_UPDATED JMS NOTIFICATION | CCM fire it when the channelSession data is update | ChannelSession Object | Publisher | Does Nothing |