Asterisk Command Reference
Quick reference guide for VoIP troubleshooting and server management
Quick Navigation
Network Diagnostics
DNS Lookup & Public IP
Resolves domain names to IP addresses and retrieves your public IP address using OpenDNS resolver.
nslookup myip.opendns.com. resolver1.opendns.com
Public IP (curl ifconfig.me)
Fetch the public IP address using ifconfig.me.
curl ifconfig.me
Trace Route
Maps the complete network path packets take from source to destination.
tracert destination
Ping Test
Tests network connectivity and measures round-trip time.
-t runs a continuous ping until stopped.
ping hostname
ping -t hostname
ARP Table
Displays the Address Resolution Protocol table.
-a shows all entries in the ARP table.
arp -a
MTR - Network Path Analysis
Combines traceroute and ping functionality.
mtr hostname
Log Analysis (Grep)
Search Current Day Logs
Search today's Asterisk full log for specific keywords.
-i ignores case while matching.
grep -i searchword /var/log/asterisk/full
Recursive Grep
Recursively search through all files.
-r searches directories recursively; -i ignores case.
grep -r "searchword" /var/log/asterisk/
grep -ri "searchword" /var/log/asterisk/
Search Historical Logs
Search compressed archived logs.
-i ignores case while matching.
zgrep -i "searchword" /var/log/asterisk/full*.*
Tail Syslog (Live)
Follow the system log in real time.
-f follows the log as new lines are added.
tail -f /var/log/syslog
Asterisk Management
Access Asterisk CLI
Open the live Asterisk console for real-time commands.
sudo asterisk -rvv
Hangup Specific Channel
Forcefully terminate a specific channel.
sudo channel request hangup 'channel name'
Check Asterisk Version
Display the current Asterisk version.
-rx runs an Asterisk CLI command and exits.
sudo asterisk -rx 'core show version'
Show Voicemail Users
Display all configured voicemail boxes.
-rx runs an Asterisk CLI command and exits.
sudo asterisk -rx 'voicemail show users'
Show Hints/BLF Status
Display all configured hints for BLF monitoring.
-rx runs an Asterisk CLI command and exits.
sudo asterisk -rx 'core show hints'
Show Dialplan
Display the complete dialplan configuration.
-rx runs an Asterisk CLI command and exits.
sudo asterisk -rx 'dialplan show'
Show Queue Status
Display the status of a specific call queue.
-rx runs an Asterisk CLI command and exits.
sudo asterisk -rx 'queue show queue number'
Monitor Channels (Auto-Refresh)
Continuously monitor active channels.
-n 1 refreshes the output every 1 second; -rx runs an Asterisk CLI command and exits.
watch -n 1 'sudo asterisk -rx "core show channels verbose"'
List All Extensions
Display all configured PJSIP contacts/extensions.
-rx runs an Asterisk CLI command and exits.
sudo asterisk -rx 'pjsip show contacts'
System Resources & Performance
View CPU Information
Display CPU architecture information.
lscpu
nproc
Check Disk Space
Display available disk space.
-h shows sizes in human-readable units.
df -h
Check Memory Usage
Display current memory usage.
-h shows sizes in human-readable units.
free -h
Monitor Running Processes
Real-time view of system processes.
top
System Uptime & Load
Show system uptime and load averages.
uptime
SAR Quick View (Today)
View current day performance stats.
-p prints output in a more readable format.
sar -p
sar
Check for OOM Killer Events
Search for Out-Of-Memory killer events.
-i ignores case while matching.
grep -i oom /var/log/syslog
Service Controls (systemctl)
Manage Services
Used to start, restart, stop, or view the status of systemctl services.
--type=service limits output to service units.
systemctl list-units --type=service
systemctl status asterisk|fail2ban
sudo systemctl start asterisk|fail2ban
sudo systemctl restart asterisk|fail2ban
sudo systemctl stop asterisk|fail2ban
Key File Paths & SCP
Spool (Temp & Voicemails)
Asterisk spool directory for temp files and voicemails.
/var/spool/asterisk/tmp
Voicemail Storage
Directory where voicemail recordings are stored (view voicemails here).
/var/spool/asterisk/voicemail/default
ls /var/spool/asterisk/voicemail/default/mailbox/INBOX
TFTP Config Files
TFTP boot config directory.
/tftpboot/config
Music on Hold
Asterisk MOH files directory (VAR > LIB > ASTERISK > MOH).
/var/lib/asterisk/moh
Mail Log
System mail log file.
/var/log/maillog
SCP: Server → Local
Download a file from the VoIP server to your local machine.
user = SSH username, server = host/IP, remote path = file on server, local path = destination folder.
scp user@server:/remote/path/file /local/path/
SCP: Local → Server
Upload a file from your local machine to the VoIP server.
user = SSH username, server = host/IP, local path = file on your machine, remote path = destination folder on server.
scp /local/path/file user@server:/remote/path/
Find Commands
Find File by Name
Search the entire filesystem for a file.
-name matches by filename; 2>/dev/null hides permission errors.
find / -name filename.ext 2>/dev/null
Find Directory by Name
Search for directories/folders by name.
-type d limits results to directories; -name matches by name; 2>/dev/null hides permission errors.
find / -type d -name directory_name 2>/dev/null
Get Real Path
Resolve the absolute path of a file or symlink.
-f resolves all symlinks to the final target.
realpath /path/to/file
readlink -f /path/to/file
