Call events (ccsevents)

Description

Telephony events for the call center layer: CCS — Calls, Connections, Seances. Built from callevents events and describe a call in terms of:

  • call — leg: server connection to one subscriber;

  • connection — dialog uniting legs (more than two during a multiple call);

  • seance — session: a chain of dialogs linked by transfers. There are no separate session events; membership is passed by the idseance field and *_attach_to_seance events.

Identifiers are used in Token API ccs requests: idcall — data.id of call_* events, idconn — data.id of connection_* events (format <callid>.<timestamp>), idseance — the idseance field.

Table 1. System characteristics

Class

ccsevents

Domain type

worker

Destination types

wssubscr, kafka (dialog domain)

Source logical roles

b2b, callstore, mix, recmover, mware (callevents events)

Handler logical role

mware (domain ccs plugin), wssubscr

Subscription and delivery

  • Subscription: "events": ["ccsevents.*"] or the ccsevents.<type> list; "objects": "any" (the event is not related to objects).

  • Subscriptions are received by Token API (websocket) and webhooks (not recommended: about 20 requests per call); to Kafka — when kafka_mustache is configured in the domain.

  • If a token has several matching subscriptions, the event arrives for each with its own sid.

  • Events of one dialog (connection) are generated sequentially and sent to domain subscribers in the same order.

  • Generation is disabled in the master domain: the value "ccs" in the events list of the disabled_plugins setting.

Notification format:

["notify", {"sid": "...", "class": "ccsevents", "type": "connection_create", "eventts": 1791975832258, "data": {...}}]

eventts — time of the source callevents event; several ccsevents events may have the same value.

Cross-domain call

Events are duplicated to the working domains whose subscribers participate in the call:

  • the domain where the first called fork appears first receives the accumulated call events (with original eventts), then current ones;

  • while a multiple call is in progress, each domain receives events of its legs and all dialog events;

  • after the answer only the answering side domain receives events; the others receive connection_delete;

  • connection_set_record_info and connection_set_asr are received by each domain for its own conversation recording.

Events

Type When

call_create

A leg was created: calling, called, or pickup

call_update

The leg is connected

call_set_state

The leg state changed

call_attach_to_seance

The leg was moved to another session

call_dtmf

A DTMF character was received

call_delete

The leg was deleted

connection_create

A dialog was created

connection_update

The dialog changed

connection_link_call

A leg was linked to the dialog

connection_attach_to_seance

The dialog was moved to another session

connection_start_record

Conversation recording started

connection_record_changed

Recording paused or resumed

connection_set_record_info

Recording placed in storage

connection_set_asr

Transcription result received

connection_failure

The call failed (before dialog creation)

connection_delete

The dialog completed

Typical order for an answered call: call_create (A) → connection_create → connection_link_call → connection_update → call_create (B) → connection_link_call → call_set_state (ringing) → call_update (A, B) → connection_update (connected) → …​ → call_set_state (finished) → call_delete (A, B) → connection_delete.

Event stream diagnostics

The Token API ccs ccs_setup request manages the recent event buffer — for reconciling what was sent by the ccs plugin and received by the connection:

["ccs_setup", {"qid": 1, "cmd": "set_ccsevents_buffer", "size": 1000}]
  • set_ccsevents_buffer — buffer size size (0..50000; 0 — disable). While the buffer is enabled, all domain events contain the orderkey (sequence number) and idc (dialog identifier) fields.

  • dump_ccsevents_buffer — dump the plugin and connection buffers to the server log and clear them.

  • ping — check the domain ccs plugin availability.