VoIP.info Guide

Asterisk AMI agent inventory, logoff and call-event evidence

Separate app_agent_pool definitions, agent login state, queue membership, AMI list completion, logoff semantics and per-call events without treating one identifier as the whole state model.

Reviewed 2026-10-26Current branch-23-generated Asterisk Agents and AgentLogoff actions, agent inventory, login, logoff and queue-call events, AgentLogin, AGENT(), app_agent_pool, AMI v2 and network-security documentation were reviewed October 26, 2026; installed version, app_agent_pool availability, agents.conf, dialplan authentication, queue membership, manager permissions and event filters, live agent channel, device state, call result, recording and FreePBX ownership remain deployment-specific; no PBX, FreePBX system, module, manager account, credential, agent, queue, channel, event stream, recording, packet, media stream or live call was inspected or testedAdvancedDocumentation based · not lab tested

Identify the agent model before querying it

Confirm the responding node, exact Asterisk build, loaded app_agent_pool, agents.conf ownership, configured agent ID, login dialplan and queue relationship. The AMI Agents action lists agents defined by app_agent_pool; it is not a universal inventory of queue members, endpoints, extensions or contact-centre users.

Keep Agent, queue MemberName, queue Interface, channel name, Uniqueid and Linkedid as distinct identifiers. Join them only from retained evidence for one time window.

Treat Agents as a bounded event list

Send a unique ActionID, retain each Agents event with that value, and close the snapshot only when its matching AgentsComplete arrives. Each item can report AGENT_LOGGEDOFF, AGENT_IDLE or AGENT_ONCALL; the channel snapshot is documented only for idle or on-call values, and TalkingToChan plus CallStarted apply only when on call.

An empty, interrupted or filtered list is not proof that no agent exists. Record list completion, item count, receive window, connection identity and event policy before comparing snapshots.

Preserve login, authentication and configuration boundaries

AgentLogin() logs an agent into the pool and assumes any authentication has already been performed by the dialplan. INVALID and ALREADY_LOGGED_IN are dialplan AGENT_STATUS outcomes, while AgentLogin is the event raised when login succeeds. The Agent:AgentId device state and AGENT() function are additional observations, not substitutes for a completed AMI list.

Configuration such as acknowledgement DTMF, automatic logoff, music on hold, recording and wrap-up time can take effect at login or after a call disconnects. A file edit or reload therefore does not prove an already logged-in agent adopted a value.

Use soft logoff deliberately

The AMI AgentLogoff action targets an agent ID. Its Soft value set to true is documented not to hang up existing calls; omitting that protection can affect an active call and requires a stricter change window. Record operator, reason, exact agent, soft policy, ActionID, response, later AgentLogoff event and a fresh completed inventory.

An accepted action is request-processing evidence. It does not by itself prove the intended agent was current, an active call survived, the login channel ended or queue membership changed.

Correlate queue-call events without flattening the legs

AgentCalled, AgentConnect, AgentComplete, AgentDump and AgentRingNoAnswer carry caller and destination channel snapshots plus queue, member and interface fields. AgentConnect adds ring and hold time; AgentComplete adds hold time, talk time and a reason. Preserve both channel identities and their unique IDs rather than joining only by caller ID or member name.

These events describe queue-call stages. They do not make an app_agent_pool agent definition identical to a queue member, prove audio, establish payroll or billing facts, or replace queue-log, CDR, CEL and recording evidence.

Bound permissions, privacy and operational claims

Use a dedicated least-privilege manager identity with only the required action and AGENT event classes, explicit source restrictions and a narrow event policy. Redact caller identity, account codes, channel names and agent activity; retain operator identity, reason, ActionID, timestamps and rollback evidence.

No PBX, FreePBX system, module, manager account, credential, agent, queue, channel, event stream, recording, packet, media stream or live call was inspected or tested. Validate one authorized disposable agent and one bounded queue call before relying on dashboards or controls.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.