VoIP.info Guide

Asterisk CLI: inspect the running system

Establish the exact running instance, loaded modules, PJSIP object graph and live call state before using a command that changes service.

Reviewed 2026-10-19Current Asterisk CLI, PJSIP troubleshooting, call-identifier and console-verbosity documentation reviewed September 30, 2026; no host, CLI, module, object, channel or call testedIntermediateDocumentation based · not lab tested

Bind the observation to one running instance

The Asterisk command-line interface exposes the running process, not every configuration file on the host. Record the host, container or VM, service identity, connection time, core show version result and core show settings output before interpreting another command. A package version, source tree and running daemon can differ.

From an authorized local shell, asterisk -r attaches to a running instance through its control socket. Access to that socket is administrative capability. Use the system's service account and permission model; do not make the socket broadly writable. A remote console also has its own current verbosity, which can differ from the root console without changing what was written to a file logger channel.

Use the help generated by the running modules

Asterisk documents that CLI commands are supplied by the core or loaded modules. If the module that owns a command is absent, the command is absent too. Use tab completion and help <command> before relying on syntax copied from another release. core show application and core show function describe dialplan interfaces, while config show help exposes configuration help generated partly at runtime.

An unavailable command is evidence about the loaded runtime, not permission to load a module during diagnosis. Record module show like <name> and the installed help. On FreePBX, trace loaded objects back to the owning module and generated configuration rather than treating a direct file edit as durable repair.

Read PJSIP as an object graph

Inspect the named endpoint and follow its relationships to AORs, contacts, auth objects, identify objects, transports and registrations. pjsip show endpoints is inventory; pjsip show endpoint <name> supplies the focused relationship view. A contact is an address binding, qualification is a bounded OPTIONS result, registration is a separate client or server relationship, and an identify match selects an endpoint before later call routing. None alone proves authorization, dialplan selection, media or a completed call.

Use exact object names and capture the output time. An aggregate endpoint state can hide which contact is available, and a realtime or generated object can differ from the static file an administrator expects. Compare loaded state with the responsible configuration source before changing either.

Treat live call output as a timed snapshot

Use core show channels to find active channels, then inspect only the channel tied to the authorized reproduction. Asterisk can create several channels and bridges for one user-visible call. The Asterisk call identifier shown in logs and channel output is not caller ID and is not necessarily the SIP Call-ID on every leg. Transfers can create a new call identifier.

Keep timestamp, channel name, linked identifiers, dialplan context and SIP dialog identifiers together. A zero-channel result after hangup does not disprove an earlier failure, and a channel's presence does not establish that media flowed or that a far-end user heard audio.

Separate observation from mutation

The CLI can obtain information, affect configuration, generate calls and execute operational actions. Inventory commands are not a blanket read-only mode. Reload, restart, module load or unload, originate, channel hangup, database writes and logger changes can alter service; the CLI ! facility executes a shell command with the Asterisk process user's authority.

Before any non-observational command, read its installed help, identify the owner, affected calls, persistence, rollback and change window. A status investigation should not silently become a reload or restart. Capture the before state and prove the intended post-change behavior with a bounded control call.

Preserve an evidence record, not a raw console dump

Record the exact version, object names, command text, timestamp and scope. Console and protocol output can contain telephone numbers, addresses, dialed destinations, account names, authorization exchanges and other operational data. Retain the original under restricted access, create a redacted sharing copy and record what was removed.

No Asterisk host, control socket, module, endpoint, contact, registration, channel, bridge, dialplan, command or call was inspected or tested for this guide. The commands are evidence prompts whose exact availability and behavior must be confirmed on the running release.

Use live state to explain a missing metric

The Prometheus diagnostic compares module, HTTP and provider state with the actual response before changing a query or alert.

Use ODBC state as one layer of the diagnosis

The func_odbc diagnostic uses odbc show to establish configured connection state, then continues to the exact function, query and result evidence.

Cross-check FreePBX report fields with narrow installed CLI commands

Use the FreePBX Asterisk Info workflow to capture one report and its exact CLI owner in the same window. The CLI can alter service, so inventory and detail commands remain separate from reload, restart, originate or module actions.

Cross-check one dashboard value with a narrow read-only command

Use the dashboard discrepancy diagnostic to select the exact installed CLI owner and capture it in the same window. Avoid reload, restart, originate and module actions during observation.

Use runtime help as branch-specific capability evidence

Runtime help and inventories show what the running instance registered. Compare them with the exact branch documentation and the version/build diagnostic, not with Latest_API alone.

Revalidate a channel before changing it

Use the channel identity guide to preserve full name, Uniqueid, Linkedid and observation time before any authorized CLI operation.

Ask the running node which functions it registered

Use core show functions, core show function DIALPLAN_EXISTS and the upgrade diagnostic before rewriting a lookup.

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.