Skip to content

click2call.call.started

Direction: modules → server. Exact event pattern: click2call.call.started.

Listener and purpose

Registered by event_handlers::EventsHandlerList::Create(Core*) in handlers/EventsHandler.hpp, independently of action handlers. The listener uses EventHandlerRecord, execution EventExecution::Inline, max_payload_size = 16384 bytes (16 KiB).

sct-click2call publishes the event when a call started by a manager connected (status became ANSWERED), to the Moleculer groups handler and server; the platform receives it as server. When the call was made by a manager personally and the recipient is a customer, the platform records the contact:

  • last_contact_time becomes the processing time, and never moves backwards: a repeated or late delivery of the same event does not roll it back;
  • first_contact_time is set to the same time only when it is empty.

The update is silent, like the last login time: the platform does not publish customer.updated, does not run workflow rules on the customer.updated trigger and does not send module events. See the customer fields in the Customers API.

Expected JSON structure

{
  "callId": 501,
  "managerId": 10,
  "callToParentType": "CUSTOMER",
  "callToParentId": 140,
  "source": "MANUAL",
  "status": "ANSWERED"
}
Parameter Type Use
source MANUAL, BULK, CAMPAIGN, TRIGGER or null Only MANUAL is counted
callToParentType CUSTOMER, LEAD, MANAGER or null Only CUSTOMER is counted
callToParentId Positive integer or null Customer ID (customer_id)
managerId Integer or null Manager who initiated the call; not read
callId Integer Call record in the Click2Call module; not read
status String Call status, ANSWERED; not read
Complete event payload — At most 16 KiB

Processing rules

Payload Result
source = MANUAL, recipient CUSTOMER with a positive id Contact recorded
source is BULK, CAMPAIGN, TRIGGER, null or missing Skipped
Recipient type LEAD, MANAGER, null or missing Skipped
Recipient id missing, null or not positive Skipped
Customer not found Skipped with a warning in the server log
Not an object, or a field of the wrong type Rejected as invalid

MANUAL means Click2CallStartCall — every call is started by a manager, so the module always sends MANUAL. Mass sends, campaigns and triggers are not a personal contact and do not change the contact time.

Leads and clients are one customer table, and current CRM addresses both as CUSTOMER with customer_id. LEAD is sent only by the legacy lead screen, and its id is the legacy lead_id, not a customer_id — so LEAD is skipped rather than written to an unrelated record.

Errors and delivery

Internal handler results: 400 on an invalid payload; 500 if the customer could not be updated; 200 for a recorded contact and for every skip. These results are not returned to the publisher. Router logs payload-limit, validation and handler failures internally.

There is no delivery ACK, persistence or offline queue: an event published while the platform is not connected is lost, and that contact is not recorded.

See the Click2Call events, shared inbound rules and the inbound catalogue.