setAgentState is the
one CSTA verb that moves an agent through the work states a contact center runs
on — logged on, ready, not-ready (with a reason), after-call-work,
and logged off. The distributor only offers queued calls to agents who are
ready, so this verb is what actually gates delivery. Drive it from your own
agent desktop, a workforce-management integration, or a supervisor tool over the
engine-native CSTA control leg — the same connection your app already uses for
call control and
routing.
This is the ECMA CSTA (ECMA-269) Set Agent State operation, exposed as the wire
verb setAgentState. It needs the agent_state scope on your CTI token; a
token without that scope has the verb refused. See
CTI Overview for how to connect and mint a
scoped token.
The agent workstation model
An agent is a routable identity (a skill member) that the ACD can offer calls to. A workstation is the endpoint the agent is answering on — a browser softphone or a real SIP deskphone.login associates the two: it puts the agent
on shift at a workstation and makes them eligible for the skills they belong to.
Everything after that is a work-state change on that logged-on agent.
The distributor keeps a live view of every agent’s state and picks only from the
ready pool. Moving an agent out of ready removes them from selection
immediately; moving them back in makes them a candidate on the next pass. That is
the whole contract between this verb and
the built-in ACD.
Wire state | CSTA agent mode | Offered ACD work? | When you set it |
|---|---|---|---|
login | Logged On | After → ready | Agent starts a shift and binds to a workstation |
ready | Ready / Available | Yes | Agent is available for the next queued call |
not-ready | Not Ready (+ aux) | No | Break, lunch, training, coaching — carry an auxReason |
after-call-work | Work Not Ready (ACW) | No | Wrap-up (disposition, notes) after a call clears |
logout | Logged Off | No | End of shift — removed from all skills |
login makes the agent eligible but does not by itself start delivering
calls — set ready explicitly when the agent is actually at the keyboard. This
mirrors real ACD ergonomics, where “logged on” and “available” are distinct so an
agent can log in, read handover notes, and only then go ready.setAgentState
The agent identity to move. This is the ACD agent id (a skill member), not the
workstation or SIP AOR. Tenant-checked against your token’s workspace.
One of
login, logout, ready, not-ready, after-call-work.A reason code for
not-ready (e.g. lunch, break, training,
meeting). Free-form and reporting-only — it does not change routing, it just
labels why the agent is unavailable so supervisors and wallboards can break
down idle time. Ignored for the other states.cti event track; subscribe it if you’re building a supervisor view (see
Routing & Events).
Move an agent through a shift
The control leg speaks length-prefixed, tab-separated<verb>\t<args-json> lines
(the first line authenticates with your scoped CTI token). You can send those
frames directly, or use the CTI client from your SDK, which wraps them.
Log the agent on at their workstation
Bind the agent to the endpoint they’ll answer on. After this they belong to
their skills but are not yet offered calls.
Go ready
Put the agent into the delivery pool. The next queued call for one of their
skills can now be offered to them.
Step away with a reason
On a break, set
not-ready with an auxReason. The distributor stops
offering calls; the reason code drives idle-time reporting.Wrap up after a call
When a call clears, set
after-call-work so the agent can disposition it
without a new call landing mid-wrap-up. Return to ready when done.How state drives delivery
When a call queues to a skill, the distributor picks from that skill’s ready members using the skill’s algorithm (expected-agent-delay / most-idle-agent, round-robin, and the other Avaya-style options described in PBX & ACD). An agent innot-ready, after-call-work, or logout is never a candidate; an agent already
on a call isn’t offered a second one. If a picked agent doesn’t accept in time,
the offer re-queues (RONA) and the picker moves on — so keeping state honest is
what keeps queues flowing.
The platform does not force agents into
after-call-work for you — your desktop
sets it explicitly after a call clears. If you want automatic wrap-up, set
after-call-work from your cleared event handler on the
CSTA event track, then transition back to
ready when the agent finishes.Two surfaces, one model. This verb is the engine twin of the state control
built into the contact-center console at
agent.telequick.dev — the console
drives its own agents through exactly these states. Use the CSTA verb when an
external app (your CRM desktop, a WFM tool, an ISV integration) owns the
agent’s presence instead. The console and the verb API move the same agents
through the same distributor. See
Contact-center platforms.Honest status
setAgentStateover the CSTA control leg — shipped, withagent_statescope enforcement, and verified moving agents across nodes in a multi-node deployment.login/ready/not-ready/after-call-work/logout— all drive the distributor’s ready pool as described.auxReason— accepted and carried into reporting; it is a label, not a routing input (a reason code never changes which agent is picked).- Automatic ACW entry on call clear — not automatic; set it from your
clearedhandler if you want it (see the note above).
Related
CTI Overview
Connect the control leg, mint a scoped CTI token, and read the framing.
Routing & Events
Register as a route point and subscribe the CSTA event track.
Call Control
Make, hold, transfer, consult, DTMF, and clear the calls agents handle.
PBX & ACD
Skills, queues, and how the distributor picks from the ready pool.
Contact-center platforms
Build a full agent desktop on top of the CSTA verbs.
High availability
Keep agent state and routing alive across node failures.