Notes:
Events describe “what happened” (server-pushed or locally emitted by the SDK).
Event constants are exposed via AgentSDK.EventType (or an equivalent enum).
Each event payload typically contains an eventType string to identify the event.
Types in 06-Types.md are the source of truth. This document provides field-level payload tables and practical notes for integration.
JavaScript
const { EventType } = AgentSDK;
const onStatus = (e) => console.log('agentStatus', e);
AgentSDK.on(EventType.AGENT_STATUS, onStatus);
AgentSDK.once(EventType.SESSION_INIT, () => console.log('session init'));
// Cleanup on unload
AgentSDK.off(EventType.AGENT_STATUS, onStatus);
Scenario Event name (eventType) EventType constantAgent status agentStatusAGENT_STATUSPreview outbound: start dialing customer previewObCallStartPREVIEW_OBCALL_STARTPreview outbound: customer ringing previewObCallRingingPREVIEW_OBCALL_RINGINGPreview outbound: bridged previewObCallBridgePREVIEW_OBCALL_BRIDGEPreview outbound: result previewObCallResultPREVIEW_OBCALL_RESULTConsult started atxferStartATXFER_STARTConsult connected atxferLinkATXFER_LINKConsult ended (resume/hangup/cancel) atxferEndedATXFER_ENDEDConsult failed atxferErrorATXFER_ERRORConsult three-way result threewayAtxferResultTHREEWAY_ATXFER_RESULTConsult three-way ended atxferThreewayUnlinkATXFER_THREEWAY_UNLINKConsult transfer completed completeAtxferResultCOMPLETE_ATXFER_RESULTRinging ringingRINGINGSession init/terminate sessionInit / sessionTerminateSESSION_INIT / SESSION_TERMINATESIP session init/terminate sipSessionInit / sipSessionTerminateSIP_SESSION_INIT / SIP_SESSION_TERMINATEReconnect attempt reconnectAttemptRECONNECT_ATTEMPTQueue status (supervisor) queueStatusQUEUE_STATUSSilent monitoring (result/link/unlink) spyResult / spyLink / spyUnlinkSPY_RESULT / SPY_LINK / SPY_UNLINKThree-way (result/link/unlink) threewayResult / threewayLink / threewayUnlinkTHREEWAY_RESULT / THREEWAY_LINK / THREEWAY_UNLINKWhisper coaching (result/link/unlink) whisperResult / whisperLink / whisperUnlinkWHISPER_RESULT / WHISPER_LINK / WHISPER_UNLINKBarge-in (result/link/unlink) bargeResult / bargeLink / bargeUnlinkBARGE_RESULT / BARGE_LINK / BARGE_UNLINKForce disconnect result disconnectResultDISCONNECT_RESULTForce offline result setOfflineResultSET_OFFLINEExtension state extenStateEXTENSTATEIVR interaction return interactReturnINTERACT_RETURNSoftphone disconnected sipDisconnectedSIP_DISCONNECTEDReal-time transcription transcriptTRANSCRIPTScheduled callback orderCallBackORDER_CALLBACKPing (latency / network) pingPINGWebRTC stats (per second in-call) webrtcStatsWEBRTC_STATS
Tip: state/stateAction values are defined in 08-State-Machine-stateAction.md. For stricter typing, use 06-Types.md.
Emitted when the agent state changes.
Field Type Description eventType string Always agentStatus tenantId string Tenant ID agentNo string Agent ID status object Agent status object (state/stateAction/initialStatus/deviceStatus/...)
Example shape:
JavaScript
{
eventType: 'agentStatus',
tenantId: 't1',
agentNo: '0001',
status: {
state: 'idle',
stateAction: 'idle',
initialStatus: 1,
deviceStatus: 0
// When deviceStatus=2/3/4, may include callType/uniqueId/mainUniqueId, etc.
}
}
Field Type Description eventType string Always previewObCallStart tenantId string Tenant ID agentNo string Agent ID customerNumber string Customer number customerNumberType number 0 landline; 1 mobileobClidAreaCode string Customer area code mainUniqueId string Main call unique id requestUniqueId string Request unique id obClid string Outbound caller ID
Field Type Description eventType string Always previewObCallRinging tenantId string Tenant ID agentNo string Agent ID customerNumber string Customer number customerNumberType number 0 landline; 1 mobileobClidAreaCode string Customer area code state string Agent state (offline/invalid/idle/busy/calling/ringing/talking/wrapup) stateAction string State action (see 08-State-Machine-stateAction.md) mainUniqueId string Main call unique id
Field Type Description eventType string Always previewObCallBridge tenantId string Tenant ID agentNo string Agent ID customerNumber string Customer number customerNumberType number 0 landline; 1 mobileobClidAreaCode string Customer area code channel string Channel name destChannel string Destination channel name mainUniqueId string Main call unique id
Field Type Description eventType string Always previewObCallResult tenantId string Tenant ID agentNo string Agent ID customerNumber string Customer number result string success connected; error failed (e.g., cancelled)uniqueId string Call unique id obClid string Outbound caller ID
Field Type Description eventType string Always ringing tenantId string Tenant ID agentNo string Agent ID callType number 1 inbound; 2 WebCall; 4 preview outbound; 5 predictive outbound; 6 outbound; 9 internal call; 11 SIP access channel string Channel name mainUniqueId string Main call unique id uniqueId string Per-leg unique id customerNumber string Customer number customerAreaCode string Area code customerProvince string Province customerCity string City subCallType number Sub-type (101/102/103/...) used to differentiate transfer/consult/monitoring, etc. hotline string Hotline numberTrunk string Trunk queueNo string Queue number chanVariables object Custom variables
Field Type Description eventType string Always atxferStart tenantId string Tenant ID agentNo string Agent ID channel string Channel name destChannel string Destination channel name state string Agent state stateAction string State action mainUniqueId string Main call unique id
Field Type Description eventType string Always atxferLink tenantId string Tenant ID agentNo string Agent ID channel string Channel name target string Consult target targetType number 0 PSTN; 1 agent; 2 extension state string Agent state stateAction string State action
Field Type Description eventType string Always atxferEnded tenantId string Tenant ID agentNo string Agent ID target string Consult target targetType number 0 PSTN; 1 agent; 2 extension hangupSide number Who hung up (consult party vs agent/customer) state string Agent state stateAction string State action
Field Type Description eventType string Always atxferError tenantId string Tenant ID agentNo string Agent ID state string Agent state stateAction string State action
Field Type Description eventType string Always threewayAtxferResult tenantId string Tenant ID agentNo string Agent ID target string Consult target targetType number 0 PSTN; 1 agent; 2 extension state string Agent state stateAction string State action
Field Type Description eventType string Always atxferThreewayUnlink tenantId string Tenant ID agentNo string Agent ID target string Consult target targetType number 0 PSTN; 1 agent; 2 extension state string Agent state stateAction string State action
Field Type Description eventType string Always completeAtxferResult tenantId string Tenant ID agentNo string Agent ID target string Consult target targetType number 0 PSTN; 1 agent; 2 extension state string Agent state stateAction string State action
Emitted when the SDK is about to attempt a reconnect. Max attempts: 20. After that, the agent should re-login.
Field Type Description eventType string Always reconnectAttempt attempt number Attempt number (starting at 1) code number 0 reconnected; -1 disconnectedfirstAttemptTs number Timestamp (ms) when reconnect loop started maxAttempts number Max attempts (fixed at 20) sinceFirstAttemptMs number Elapsed time since first attempt (ms)
Field Type Description eventType string Always queueStatus queueStatus object Map: { "<queueNo>": { queueParams, agentStatuses, queueEntries } }
See queue types in 06-Types.md.
Field Type Description eventType string Always spyResult tenantId string Tenant ID agentNo string Agent ID spiedCno string Target agent ID initiator string Monitoring initiator initiatorType number 0 PSTN; 1 agent; 2 extension uniqueId string Call unique id result string success or error
Field Type Description eventType string Always spyLink tenantId string Tenant ID agentNo string Agent ID spiedCno string Target agent ID initiator string Monitoring initiator initiatorType number 0 PSTN; 1 agent; 2 extension result string success or errorchannel string Channel name
Field Type Description eventType string Always spyUnlink tenantId string Tenant ID agentNo string Agent ID spiedCno string Target agent ID initiator string Monitoring initiator initiatorType number 0 PSTN; 1 agent; 2 extension
Field Type Description eventType string Always threewayResult tenantId string Tenant ID agentNo string Agent ID threewayedCno string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension uniqueId string Call unique id result string success or error
Field Type Description eventType string Always threewayLink tenantId string Tenant ID agentNo string Agent ID threewayedCno string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension channel string Channel name
Field Type Description eventType string Always threewayUnlink tenantId string Tenant ID agentNo string Agent ID threewayedAgentNo string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension
Field Type Description eventType string Always whisperResult tenantId string Tenant ID agentNo string Agent ID whisperedCno string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension uniqueId string Call unique id result string success or error
Field Type Description eventType string Always whisperLink tenantId string Tenant ID agentNo string Agent ID whisperedCno string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension channel string Channel name
Field Type Description eventType string Always whisperUnlink tenantId string Tenant ID agentNo string Agent ID whisperedAgentNo string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension
Field Type Description eventType string Always bargeResult tenantId string Tenant ID agentNo string Agent ID bargedAgentNo string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension uniqueId string Call unique id result string success or error
Field Type Description eventType string Always bargeLink tenantId string Tenant ID agentNo string Agent ID bargedAgentNo string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension channel string Channel name
Field Type Description eventType string Always bargeUnlink tenantId string Tenant ID agentNo string Agent ID bargedCno string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension
Field Type Description eventType string Always disconnectResult tenantId string Tenant ID agentNo string Agent ID disconnectorCno string Target agent ID initiator string Initiator initiatorType number 0 PSTN; 1 agent; 2 extension uniqueId string Call unique id result string success or error
Field Type Description eventType string Always setOfflineResult tenantId string Tenant ID agentNo string Agent ID initiator string Who forced offline (supervisor agentNo or admin name) code string 0 success; -1 failuremessage string Message (commonly ok)
This event exists (eventType=orderCallBack, EventType.ORDER_CALLBACK), but the current source documentation does not provide a field-level payload contract.
Recommended approach:
Treat it as a pass-through event and branch on eventType=orderCallBack
If you must rely on concrete fields, confirm the payload contract with the backend team before integration
Field Type Description eventType string Always extenState state string Reachable / UnreachableregisterState string Registered / UnregisteredregisterTime string Registration time (e.g., 2024-01-01 10:54:19) expirationTime string Expiration time extenIp string Phone IP URI string Registration URI extenNo string Extension number tenantId string Tenant ID
Field Type Description eventType string Always interactReturn tenantId string Tenant ID agentNo string Agent ID returnVariables object Return variables (provided via transferIvr)
Emitted when the softphone connection is interrupted. In most cases, the agent should re-login / recreate the softphone session.
Naming note: legacy docs may mention transcriptEvent or rasr. The SDK public eventType is transcript.
Field Type Description eventType string Always transcript text string Transcribed sentence text role number 1 agent side; 2 customer sidetranscriptTime number Absolute timestamp (ms) when text is generated beginTime number Relative begin time from recording start (ms) endTime number Relative end time from recording start (ms) finished number 1 finished; 0 in progresssentenceIndex number Index, starting from 0 sentenceType string intermediateResult / sentenceEndmainUniqueId string Main call unique id sentenceBeginTimestamp number Timestamp (ms) when engine started for the sentence (returned with sentenceEnd) sentenceEndTimestamp number Timestamp (ms) when final text returned (returned with sentenceEnd)
Field Type Description eventType string Always ping latencyTime number Ping latency in ms networkState number Network quality bucket derived from latency
Requires webrtcStats=true in setup() (or tenant-side enablement). Emitted once per second during a softphone call.
The payload is large; treat it as WebrtcStatsEvent from 06-Types.md. Key fields include:
iceState, dtlsState
packetsSent/packetsReceived, packetsState
jitter, rtt, packetLossRate
sentNetworkQuality, receivedNetworkQuality
For key event sequences (preview outbound / consult flows), see 10-Key-Flows-Sequence-Diagrams.md.