CLI Commands Quick Reference
Asterisk's command-line interface (CLI) is the primary tool for real-time monitoring, debugging, and management. Access it with asterisk -r (connect to running instance) or asterisk -rvvvv (connect with high verbosity).
Exit the CLI with quit or Ctrl+C.
Connecting to the Console
# Attach to a running Asterisk instance
asterisk -r
# Attach with verbosity level 4 (more detail)
asterisk -rvvvv
# Run a single command without entering the console
asterisk -rx "pjsip show endpoints"
PJSIP Commands
| Command |
Description |
pjsip show endpoints |
List all PJSIP endpoints and their status |
pjsip show endpoint <name> |
Show detailed info for a specific endpoint |
pjsip show aors |
List all Address of Record entries |
pjsip show registrations |
Show outbound registrations |
pjsip show contacts |
Show all registered contacts |
pjsip show channels |
Show active PJSIP channels |
pjsip set logger on/off |
Enable or disable PJSIP SIP message logging |
pjsip reload |
Reload PJSIP configuration |
Legacy SIP Commands (chan_sip)
| Command |
Description |
sip show peers |
Display SIP peers |
sip show peer <account> |
Display specific SIP peer details |
sip show users |
Display SIP users |
sip show registry |
Display SIP registrations |
sip show settings |
Display SIP global settings |
sip set debug on/off |
Enable or disable SIP debugging |
sip set debug ip <addr> |
Debug SIP traffic filtered by IP address |
sip set debug peer <name> |
Debug SIP traffic filtered by peer name |
sip reload |
Reload SIP configuration |
Dialplan Commands
| Command |
Description |
dialplan show |
Show the entire dialplan |
dialplan show <context> |
Show dialplan for a specific context |
dialplan show <exten>@<context> |
Show a specific extension in a context |
dialplan reload |
Reload the dialplan from config files |
Channel Commands
| Command |
Description |
core show channels |
List all active channels |
core show channels verbose |
Detailed active channel listing |
core show channel <name> |
Show details for a specific channel |
channel originate <chan> application <app> <args> |
Originate a test call |
channel redirect <chan> <context>,<exten>,<pri> |
Redirect a live channel |
channel hangup <chan> |
Hang up a specific channel |
System Commands
| Command |
Description |
core show settings |
Display Asterisk configuration summary |
core show uptime |
Show how long Asterisk has been running |
core show channeltypes |
List channel types (PJSIP, DAHDI, etc.) |
core show translation |
Display codec translation cost matrix |
core set verbose <level> |
Set console verbosity (0-10) |
core restart now |
Restart Asterisk immediately |
core restart gracefully |
Restart after all calls end |
core stop now |
Stop Asterisk immediately |
core stop gracefully |
Stop after all calls end |
reload |
Reload all module configurations |
module show |
List all loaded modules |
module show like <pattern> |
List modules matching a pattern |
module load <module> |
Load a module |
module reload <module> |
Reload a specific module |
module unload <module> |
Unload a module |
Voicemail Commands
| Command |
Description |
voicemail show users |
List all voicemail boxes |
voicemail show users for <context> |
List voicemail boxes in a context |
voicemail show zones |
Show voicemail timezone zones |
voicemail reload |
Reload voicemail configuration |
Queue Commands
| Command |
Description |
queue show |
Show all queues and their members |
queue show <name> |
Show a specific queue |
queue add member <chan> to <queue> |
Add a member to a queue |
queue remove member <chan> from <queue> |
Remove a member from a queue |
queue pause member <chan> in <queue> |
Pause a queue member |
queue unpause member <chan> in <queue> |
Unpause a queue member |
queue reload all |
Reload queue configuration |
ConfBridge Commands
| Command |
Description |
confbridge list |
List active conferences |
confbridge show profile bridge <name> |
Show a bridge profile |
confbridge show profile user <name> |
Show a user profile |
confbridge kick <conf> <channel> |
Kick a participant |
confbridge mute <conf> <channel> |
Mute a participant |
confbridge unmute <conf> <channel> |
Unmute a participant |
AstDB Commands
| Command |
Description |
database show |
Show all AstDB entries |
database show <family> |
Show entries in a family |
database get <family> <key> |
Get a specific value |
database put <family> <key> <value> |
Store a value |
database del <family> <key> |
Delete a specific entry |
database deltree <family> |
Delete an entire family |
Music on Hold Commands
| Command |
Description |
moh show classes |
List MOH classes |
moh show files |
Show files loaded for each MOH class |
moh reload |
Reload MOH configuration |
Tips
- Increase verbosity at runtime with
core set verbose 5 to see more dialplan execution detail.
- Use
module show like pjsip to check which PJSIP modules are loaded: missing modules are a common cause of registration failures.
- Run commands from a shell script with
asterisk -rx "command". This is useful for cron jobs and monitoring scripts.
- Tab completion works in the CLI: type
pjsip show and press Tab to see available subcommands.
- The
help command shows usage for any command: help dialplan show explains all arguments.
- For PJSIP systems, ignore the legacy
sip commands entirely. They only work with chan_sip, which is deprecated since Asterisk 17.