VoIP.info Guide

Asterisk CLI: inspect the running system

Use read-only commands to establish version, active channels and PJSIP state before changing configuration.

Reviewed 2026-09-07Asterisk 22 LTSIntermediateDocumentation based · not lab tested

Connect to the intended instance

The Asterisk command-line interface exposes the running engine's state. Verify that you are connected to the expected host and instance before interpreting its output. A container, VM and host service can have separate processes and configurations.

From a permitted local shell, asterisk -r connects to a running instance. Your operating-system account needs access to the control socket. Resolve permissions through the system's administration model; do not make the socket globally writable as a shortcut.

Ask specific questions

core show version identifies the engine. core show channels lists active channels. pjsip show endpoints shows loaded endpoint state. dialplan show inspects the active dialplan. Use command completion and built-in help when an argument is unclear.

Read output as a snapshot. An endpoint with a contact is not proof of a successful call, and a channel count is not necessarily equal to the number of conversations. A PBX frequently creates more than one channel per call.

Asterisk CLI — observation only
core show version
core show channels
pjsip show endpoints
pjsip show contacts
dialplan show lab-internal

Keep diagnostics bounded

Raising verbosity or enabling protocol logging can generate sensitive and voluminous output. Note the previous setting, collect one reproducible example and restore the diagnostic level afterward. On a busy system, broad logging can complicate both privacy and performance.

Avoid copying raw traces into tickets without removing identities and secrets. Preserve method, sequence, timestamps and sanitized addresses so the diagnostic value remains.

Know which commands change service

Reload, restart, originate and hangup operations are not read-only checks. They can alter call behavior or interrupt service. Before using them, identify the intended effect and schedule an appropriate change window. A status investigation should not unexpectedly become a service restart.

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.