Asterisk CLI Commands
Asterisk SIP Peer Management
Manage and monitor your Asterisk SIP peers effectively using command-line interface (CLI) commands. This section covers essential commands for viewing peer status, detailed information, and registrations.
# Display the status of all SIP peers
asterisk -rx "sip show peers"
# Show detailed information about a specific SIP peer
asterisk -rx "sip show peer [peer-name]"
# List active SIP registrations
asterisk -rx "sip show registry"
# Unregister a specific SIP user
asterisk -rx "sip unregister [peer-name]"
# Check active SIP channels and their call status
asterisk -rx "sip show active"
Asterisk SIP Configuration and Status
Reload SIP configurations without restarting the entire Asterisk service and check the current status of SIP channels and options. These commands are crucial for dynamic configuration updates and network diagnostics.
# Reload SIP configurations without restarting Asterisk
asterisk -rx "sip reload"
# Display the current SIP channel statistics
asterisk -rx "sip show channels"
# Check the status of SIP options (qualify packets)
asterisk -rx "sip show options"
Asterisk SIP Debugging and Monitoring
Enable and disable SIP debugging to troubleshoot communication issues. Monitor specific SIP channels and gain insights into network traffic by turning debug on for specific peers or IP addresses.
# Monitor a specific SIP channel
asterisk -rx "sip show channel [channel-name]"
# Turn on SIP debug for a specific IP or peer
asterisk -rx "sip set debug peer [peer-name]" or asterisk -rx "sip set debug ip [ip-address]"
# Turn off SIP debug
asterisk -rx "sip set debug off"
# Set SIP debug on globally
asterisk -rx "sip set debug on"
# Set SIP debug off globally
asterisk -rx "sip set debug off"
Asterisk SIP Command Overview
This comprehensive guide provides an overview of essential Asterisk CLI commands for managing SIP communications. From basic peer status checks to advanced debugging, these commands are vital for any Asterisk administrator.
For more in-depth information on SIP and Asterisk, refer to the official Asterisk documentation and the SIP RFC 3261.