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

Source: https://srvscripts.com/guides/asterisk-cli-commands-cheat-sheet/
Updated: 2026-10-07
Publisher: srvScripts (https://srvscripts.com/)

**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

| Command | What it shows |
| --- | --- |
| core show version | Asterisk version and build host |
| core show uptime | System uptime and time since the last reload |
| core show calls | Active calls and total calls processed since start |
| core show channels | Active channels; add concise, verbose or count |
| core show channel  | Full detail for one channel (variables, codecs, bridge) |
| core show sysinfo | RAM, swap, process count as Asterisk sees them |
| core show settings | Core settings, including directories and max calls |
| core show taskprocessors | Queue depth per task processor; useful when the PBX feels slow |
| module show like pjsip | Which 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.

| Command | Use it to |
| --- | --- |
| pjsip show endpoints | List every endpoint with its state, contacts and channels |
| pjsip show endpoint 201 | Full settings of one endpoint (codecs, context, NAT options) |
| pjsip show contacts | Registered contacts with status (Avail, Unavail, NonQual, Unknown) and round-trip time |
| pjsip show aors | AORs and their contacts; pjsip show aor 201 for one |
| pjsip show auths | Auth objects used by endpoints and registrations |
| pjsip show registrations | Outbound registrations to providers: Registered, Rejected, Unregistered |
| pjsip show identifies | IP-based matching rules for trunks |
| pjsip show transports | Bound transports (UDP, TCP, TLS, WSS) and addresses |
| pjsip show channels | Active PJSIP channels |
| pjsip show channelstats | Live RTP stats per channel: packet loss, jitter, RTT |
| pjsip show settings | Global and system options |
| pjsip show unidentified_requests | Sources sending requests that matched no endpoint (scanner traffic) |
| pjsip list endpoints | Compact 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:
==========================================================================================

Transport:  0.0.0.0-udp               udp      3     96  0.0.0.0:5060

Objects found: 1
```

## Qualify, register and maintenance actions

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

| Command | What it does |
| --- | --- |
| pjsip set logger on | Print every SIP message in and out |
| pjsip set logger host 203.0.113.10 | Only SIP to and from one host or subnet |
| pjsip set logger method INVITE | Only one request method (also REGISTER, OPTIONS, BYE and others) |
| pjsip set logger pcap /tmp/sip.pcap | Write SIP to a pcap file for Wireshark or sngrep |
| pjsip set logger off | Stop SIP logging |
| pjsip set history on | Keep a history buffer of SIP messages; read with pjsip show history |
| rtp set debug ip 203.0.113.10 | Show RTP packets to and from one host (optionally host:port) |
| rtp set debug off | Stop RTP debugging |
| rtp show settings | RTP port range, strict RTP, ICE and STUN settings |
| rtcp set stats on | Print 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](/guides/troubleshoot-sip-sngrep/) shows how to read the same traffic, and the [SIP Trace Analyzer](/tools/sip-trace-analyzer/) flags NAT and codec problems in a pasted log.

## Dialplan, applications and functions

| Command | What it does |
| --- | --- |
| dialplan show | Whole dialplan (long on FreePBX) |
| dialplan show from-internal | One context |
| dialplan show 2125551234@from-internal | Which extensions in that context match a number, in priority order |
| dialplan reload | Reload extensions.conf only |
| core show application Dial | Syntax and options of an application |
| core show function CALLERID | Syntax of a dialplan function |
| core show hints | BLF hints and their current state |
| dialplan show globals | Global variables |
| database show | AstDB contents; database show  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](/guides/asterisk-dialplan-pattern-matching/) 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

| Command | What it does |
| --- | --- |
| core set verbose 5 | Raise verbosity on this console (core set verbose off to silence) |
| core set debug 3 res_pjsip.so | Debug messages for one module (core set debug off) |
| logger show channels | Which log files exist and which levels they receive |
| logger rotate | Rotate and reopen log files |
| logger reload | Reopen log files after editing logger.conf |
| module reload | Reload all modules that support reload (or name one, e.g. module reload res_pjsip.so) |
| core reload | Global reload |
| core restart when convenient | Restart once all calls have ended |
| core restart gracefully | Stop accepting new calls, restart when current calls end |
| core stop gracefully | Same, 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

| Command | What it does |
| --- | --- |
| channel request hangup PJSIP/201-00000012 | Hang up one channel; accepts all, globs like PJSIP/* or a /regex/ |
| channel originate PJSIP/201 extension 600@from-internal | Place a test call from a phone to an extension |
| mixmonitor start  | Start recording a live channel (stop and list also exist) |
| queue show | Queues, members and waiting callers |
| queue {pause|unpause} member | Pause an agent |
| confbridge list | Active conferences |
| voicemail show users | Mailboxes |
| cdr show status | Whether 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 command | PJSIP equivalent |
| --- | --- |
| sip show peers | pjsip show endpoints or pjsip show contacts |
| sip show peer 201 | pjsip show endpoint 201 |
| sip show registry | pjsip show registrations |
| sip set debug on | pjsip set logger on |
| sip set debug ip 203.0.113.10 | pjsip set logger host 203.0.113.10 |
| sip reload | module reload res_pjsip.so |
| sip qualify peer 201 | pjsip qualify 201 |
| sip show channels | pjsip show channels |

Still migrating? Our [chan_sip to PJSIP migration guide](/guides/chan-sip-to-pjsip-migration/) covers the converter script and option mapping.

**Official documentation:** [Asterisk CLI documentation](https://docs.asterisk.org/Operation/Asterisk-Command-Line-Interface/) · [Asterisk PJSIP configuration](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/) · [Asterisk versions](https://docs.asterisk.org/About-the-Project/Asterisk-Versions/)

**Related:** [Troubleshoot SIP Calls with sngrep and the Asterisk PJSIP Logger](/guides/troubleshoot-sip-sngrep/) · [SIP Trace Analyzer: Find NAT, Codec and Dropped-Call Problems in a SIP Log](/tools/sip-trace-analyzer/) · [PJSIP Behind NAT: Asterisk and FreePBX Settings for Two-Way Audio](/guides/pjsip-nat-asterisk-freepbx/) · [SIP Response Codes: Lookup for Every SIP Error, With Causes and Fixes](/tools/sip-response-codes/) · [Install Asterisk 22 LTS on Debian 13: Step-by-Step Guide](/guides/install-asterisk-22-debian/)

**See also:** [chan_sip to PJSIP Migration: sip_to_pjsip.py, Option Mapping, Tests](/guides/chan-sip-to-pjsip-migration/) · [sip.conf to pjsip.conf Converter for Asterisk](/tools/sip-to-pjsip-converter/) · [PJSIP Endpoint Unreachable or Unavailable: Fix Qualify and NAT](/guides/pjsip-endpoint-unreachable-qualify/) · [FreePBX PJSIP Trunk Setup: Registration, IP Auth, Routes, NAT](/guides/freepbx-pjsip-trunk-setup/)

**See also:** [Asterisk pjsip_wizard.conf: Endpoints and Trunks in a Few Lines](/guides/asterisk-pjsip-wizard/) · [Asterisk AMI Originate a Call with Python](/guides/asterisk-ami-originate-call-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.
