Emergency server help: get in touch

Asterisk CLI Commands Cheat Sheet: PJSIP, Calls, Dialplan, Logs

PJSIP-era Asterisk CLI cheat sheet: endpoints, contacts, registrations, SIP and RTP debugging, dialplan, logging and safe restarts, checked on Asterisk 22.

Published Updated 9 min read

Short answer: Connect with asterisk -rvvv (or run one command with asterisk -rx "command"). The commands you will use most on a modern PJSIP system are pjsip show endpoints, pjsip show contacts, pjsip show registrations, core show channels, dialplan show and pjsip set logger on. The old sip show peers family is gone because chan_sip was removed in Asterisk 21.

We ran these commands on our lab server (Debian 12, FreePBX 17.0.33, Asterisk 22.11) on 6 October 2026. Every command below appears in that server’s core show help list. Commands that change state (reload, restart, hangup) were checked with core show help only, not run on a live call.

Connect to the Asterisk CLI

Asterisk runs as a background daemon. You attach a console to it with -r (remote). Each extra v raises the verbosity of that console only.

asterisk -rvvv                              # interactive console, verbose level 3
asterisk -rx "core show version"            # run one command and exit (good for scripts)
asterisk -rx "pjsip show endpoints" | less  # pipe long output

Inside the console, exit or quit detaches without stopping Asterisk. Never type core stop now to leave the console: it stops the PBX and drops every call.

To find a command you half remember, use the built-in help. It accepts partial commands:

core show help pjsip show
core show help dialplan

On our lab, core show help listed 412 lines. On FreePBX the CLI is the same Asterisk CLI; FreePBX adds its own tool, fwconsole, for the GUI side (reload, module admin, backups).

System status: version, uptime, calls and channels

CommandWhat it shows
core show versionAsterisk version and build host
core show uptimeSystem uptime and time since the last reload
core show callsActive calls and total calls processed since start
core show channelsActive channels; add concise, verbose or count
core show channel <name>Full detail for one channel (variables, codecs, bridge)
core show sysinfoRAM, swap, process count as Asterisk sees them
core show settingsCore settings, including directories and max calls
core show taskprocessorsQueue depth per task processor; useful when the PBX feels slow
module show like pjsipWhich PJSIP modules are loaded and running

Example from our lab (masked output, idle system):

Asterisk 22.11.0 built by jenkins @ 80c01f94bd66 on a x86_64 running Linux on 2026-08-31 08:55:03 UTC

System uptime: 3 hours, 2 minutes, 42 seconds
Last reload: 3 hours, 30 seconds

core show channels count is the quickest way to feed a monitoring check. core show calls uptime seconds adds the uptime in seconds, which is handy for scripts.

PJSIP endpoints, contacts, registrations and transports

PJSIP splits a phone or trunk into several objects: an endpoint (call settings), an aor (where to reach it), an auth (credentials), a contact (the live address a phone registered from), an identify (match by source IP) and a registration (Asterisk registering out to a provider). Each has its own show command.

CommandUse it to
pjsip show endpointsList every endpoint with its state, contacts and channels
pjsip show endpoint 201Full settings of one endpoint (codecs, context, NAT options)
pjsip show contactsRegistered contacts with status (Avail, Unavail, NonQual, Unknown) and round-trip time
pjsip show aorsAORs and their contacts; pjsip show aor 201 for one
pjsip show authsAuth objects used by endpoints and registrations
pjsip show registrationsOutbound registrations to providers: Registered, Rejected, Unregistered
pjsip show identifiesIP-based matching rules for trunks
pjsip show transportsBound transports (UDP, TCP, TLS, WSS) and addresses
pjsip show channelsActive PJSIP channels
pjsip show channelstatsLive RTP stats per channel: packet loss, jitter, RTT
pjsip show settingsGlobal and system options
pjsip show unidentified_requestsSources sending requests that matched no endpoint (scanner traffic)
pjsip list endpointsCompact one-line-per-object list (also list contacts, list aors)

Most list commands take a filter. Our lab confirmed pjsip show contacts like <pattern> and pjsip show channelstats like <pattern>, where the pattern is a regular expression:

pjsip show contacts like ^20
pjsip show channelstats like trunk

Transport output from our lab (a FreePBX 17 install with the default UDP transport):

Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress....................>
==========================================================================================

Transport:  0.0.0.0-udp               udp      3     96  0.0.0.0:5060

Objects found: 1

Qualify, register and maintenance actions

CommandWhat it does
pjsip qualify 201Send a SIP OPTIONS request to all contacts on the endpoint now
pjsip send register <registration>Unregister then re-register one outbound registration; *all for every one
pjsip send unregister <registration>Unregister and stop future attempts (until reload)
pjsip show qualify endpoint 201Current qualify options for the endpoint’s AORs
pjsip set maintenancePut an endpoint into maintenance mode (Asterisk 22 command; see core show help pjsip set maintenance)
module reload res_pjsip.soReload PJSIP configuration

Transport changes (bind address, protocol, TLS files) are not applied by a reload. The Asterisk documentation says transport changes take effect only after a full restart. Use core restart when convenient so active calls finish first.

SIP and RTP debugging

These are the commands to reach for when calls fail or audio is missing. Turn them off when you are done; they are noisy on a busy server.

CommandWhat it does
pjsip set logger onPrint every SIP message in and out
pjsip set logger host 203.0.113.10Only SIP to and from one host or subnet
pjsip set logger method INVITEOnly one request method (also REGISTER, OPTIONS, BYE and others)
pjsip set logger pcap /tmp/sip.pcapWrite SIP to a pcap file for Wireshark or sngrep
pjsip set logger offStop SIP logging
pjsip set history onKeep a history buffer of SIP messages; read with pjsip show history
rtp set debug ip 203.0.113.10Show RTP packets to and from one host (optionally host:port)
rtp set debug offStop RTP debugging
rtp show settingsRTP port range, strict RTP, ICE and STUN settings
rtcp set stats onPrint RTCP statistics

The full syntax, taken from the Asterisk 22 source, is pjsip set logger {on|off|host <name/subnet>|add <name/subnet>|method <method>|methodadd <method>|verbose <on/off>|pcap <filename>}. add and methodadd extend an existing filter instead of replacing it.

Our lab’s rtp show settings on a stock FreePBX 17 install:

General Settings:
----------------
  Port start:      10000
  Port end:        20000
  Checksums:       Yes
  DTMF Timeout:    1200
  Strict RTP:      Yes
  Probation:       4 frames
  Replay Protect:  Yes
  ICE support:     Yes
  STUN:            disabled

For a friendlier view of SIP ladders, our sngrep guide shows how to read the same traffic, and the SIP Trace Analyzer flags NAT and codec problems in a pasted log.

Dialplan, applications and functions

CommandWhat it does
dialplan showWhole dialplan (long on FreePBX)
dialplan show from-internalOne context
dialplan show 2125551234@from-internalWhich extensions in that context match a number, in priority order
dialplan reloadReload extensions.conf only
core show application DialSyntax and options of an application
core show function CALLERIDSyntax of a dialplan function
core show hintsBLF hints and their current state
dialplan show globalsGlobal variables
database showAstDB contents; database show <family> to narrow

dialplan show <number>@<context> is the fastest way to answer “which route will this number take?”. We used it on lab3 to test patterns; see our dialplan pattern matching guide for real output.

On FreePBX, fwconsole context from-internal prints a context too. Edits to FreePBX-generated files are overwritten; put custom dialplan in extensions_custom.conf.

Logging, reloads and restarts

CommandWhat it does
core set verbose 5Raise verbosity on this console (core set verbose off to silence)
core set debug 3 res_pjsip.soDebug messages for one module (core set debug off)
logger show channelsWhich log files exist and which levels they receive
logger rotateRotate and reopen log files
logger reloadReopen log files after editing logger.conf
module reloadReload all modules that support reload (or name one, e.g. module reload res_pjsip.so)
core reloadGlobal reload
core restart when convenientRestart once all calls have ended
core restart gracefullyStop accepting new calls, restart when current calls end
core stop gracefullySame, but stop instead of restart

logger show channels on our lab, after we added a fail2ban log channel:

Channel                             Type     Formatter  Status    Configuration
-------                             ----     ---------  ------    -------------
/var/log/asterisk/fail2ban          File     default    Enabled    - NOTICE SECURITY
/var/log/asterisk/full              File     default    Enabled    - DEBUG NOTICE WARNING ERROR VERBOSE

On FreePBX, prefer fwconsole reload after GUI changes and fwconsole restart for a full restart. They regenerate the config files before Asterisk reloads them.

Calls, recordings and queues

CommandWhat it does
channel request hangup PJSIP/201-00000012Hang up one channel; accepts all, globs like PJSIP/* or a /regex/
channel originate PJSIP/201 extension 600@from-internalPlace a test call from a phone to an extension
mixmonitor start <channel>Start recording a live channel (stop and list also exist)
queue showQueues, members and waiting callers
queue {pause|unpause} memberPause an agent
confbridge listActive conferences
voicemail show usersMailboxes
cdr show statusWhether CDR logging is on and in which mode

channel request hangup all drops every call on the server. Run core show channels first and hang up by name.

chan_sip commands and their PJSIP replacements

Older guides still show chan_sip commands. They do not exist on Asterisk 21 or later. Use this map:

Old chan_sip commandPJSIP equivalent
sip show peerspjsip show endpoints or pjsip show contacts
sip show peer 201pjsip show endpoint 201
sip show registrypjsip show registrations
sip set debug onpjsip set logger on
sip set debug ip 203.0.113.10pjsip set logger host 203.0.113.10
sip reloadmodule reload res_pjsip.so
sip qualify peer 201pjsip qualify 201
sip show channelspjsip show channels

Still migrating? Our chan_sip to PJSIP migration guide covers the converter script and option mapping.

Official documentation: Asterisk CLI documentation · Asterisk PJSIP configuration · Asterisk versions

Related: Troubleshoot SIP Calls with sngrep and the Asterisk PJSIP Logger · SIP Trace Analyzer: Find NAT, Codec and Dropped-Call Problems in a SIP Log · PJSIP Behind NAT: Asterisk and FreePBX Settings for Two-Way Audio · SIP Response Codes: Lookup for Every SIP Error, With Causes and Fixes · Install Asterisk 22 LTS on Debian 13: Step-by-Step Guide

See also: chan_sip to PJSIP Migration: sip_to_pjsip.py, Option Mapping, Tests · sip.conf to pjsip.conf Converter for Asterisk · PJSIP Endpoint Unreachable or Unavailable: Fix Qualify and NAT · FreePBX PJSIP Trunk Setup: Registration, IP Auth, Routes, NAT

See also: Asterisk pjsip_wizard.conf: Endpoints and Trunks in a Few Lines · Asterisk AMI Originate a Call with Python

Frequently asked questions

How do I open the Asterisk CLI?

Run asterisk -rvvv as root or the asterisk user. Use asterisk -rx “command” to run a single command from the shell. Type exit to leave without stopping Asterisk.

What replaced sip show peers?

On PJSIP use pjsip show endpoints for configured devices and pjsip show contacts for registered addresses and their reachability. chan_sip and its commands were removed in Asterisk 21.

How do I see SIP traffic in Asterisk?

Run pjsip set logger on, or narrow it with pjsip set logger host 203.0.113.10. Turn it off with pjsip set logger off. For a pcap file use pjsip set logger pcap /tmp/sip.pcap.

Is core reload safe during business hours?

A reload does not drop calls, but PJSIP transport changes need a full restart. For restarts use core restart when convenient so Asterisk waits for active calls to end.

Why do my CLI changes disappear on FreePBX?

FreePBX regenerates most Asterisk config files on every fwconsole reload. Make changes in the GUI or in the _custom.conf files, not in generated files.

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.