VoIP.info Guide

Asterisk AMI PJSIP maintenance mode and status evidence

Use versioned AMI actions to drain one PJSIP endpoint without treating command acceptance, status events or SIP rejection as the same proof.

Reviewed 2026-10-21Current branch-20, branch-22, certified-22.8 and branch-23 PJSIP maintenance action, status-event and completion-event references plus current AMI, Dial and upgrade guidance were reviewed October 21, 2026. The action is documented as introduced in Asterisk 20.20.0, 22.10.0 and 23.4.0, so installed release, distributor patches, loaded modules, manager actions, permissions, endpoint names, active dialogs, node scope, reload and restart behavior remain deployment specific. No PBX, module, manager account, endpoint, dialog, registration, SIP request, channel, ARI operation, packet, route, media stream or live call was inspected or testedAdvancedDocumentation based · not lab tested

Gate the workflow on the installed maintenance release

PJSIPSetMaintenance is documented as introduced in Asterisk 20.20.0, 22.10.0 and 23.4.0. Verify the running release, loaded PJSIP modules and manager action inventory before designing an automation; branch documentation alone does not prove that an older or distributor-patched node exposes the action.

Record node identity and release alongside every result. A mixed-version cluster can accept the same AMI request on one node and reject it as unknown on another.

Set one endpoint deliberately

PJSIPSetMaintenance requires an exact Endpoint and State of on or off. The special endpoint value all targets all endpoints, so reserve it for a controlled, explicitly approved scope rather than using it as a convenient substitute for inventory.

A successful AMI response means the action request was accepted. Preserve the correlated PJSIPMaintenanceStatus event and then request a fresh status snapshot; neither one alone proves the whole operational drain completed.

Read show output as a framed snapshot

PJSIPShowMaintenance can query one endpoint. With no endpoint supplied, it emits status rows for endpoints currently in maintenance mode, followed by PJSIPMaintenanceStatusComplete. Correlate the initial response, every row and the completion event under one ActionID; AMI v2 treats EventList: complete as terminal list framing, not as another action response.

Absence from the unfiltered list means the endpoint was not returned as maintenance-enabled in that completed snapshot. It is not proof that the endpoint does not exist. A specific-endpoint query is the clearer check when the target is known.

Keep the documented traffic effects precise

While maintenance mode is enabled, new inbound out-of-dialog requests are documented as rejected with 503 Service Unavailable, except SUBSCRIBE and REGISTER requests whose Expires value is 0. Outbound origins through Dial() or ARI are refused before a SIP session and channel are created.

In-progress dialogs are documented as unaffected. Maintenance mode is therefore a targeted drain control, not a PBX shutdown, registration outage, transport failure, contact-qualification result or proof that every kind of traffic stopped.

Separate control, state and behavior evidence

Keep six timestamps distinct: manager request, initial response, emitted status-change event, completed show snapshot, observed inbound SIP result and observed outbound Dial or ARI result. An action response cannot substitute for the later layers, and a 503 without correlation does not identify maintenance mode as its cause.

In HA deployments, prove which node owns the endpoint and dialog. Node-local runtime state must not be projected across a cluster without a per-node snapshot and traffic-path evidence.

Drain, maintain and restore with an explicit exit check

Before enabling maintenance, inventory the intended endpoint, active work and rollback owner. Enable it, verify the completed snapshot, observe only authorized synthetic traffic, finish the maintenance, set the endpoint off, and repeat the snapshot plus positive and negative behavior checks.

Recheck after any reload, module restart or process restart instead of assuming persistence. No PBX, endpoint, dialog, SIP request, channel, ARI operation, packet, media stream or live call was inspected or tested.

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.