Video 17: How to Set-up Asterisk CLI
This video instructs you on viewing usage statistics and metrics for your phone system using some basic commands in the Asterisk Command Line Interface to monitor your extensions, trunks, or live calls.
1. Browse to your DigitalOcean droplet where you created your new PBX
- Type “asterisk -r” to bring you into the command line for your PBX
- Type “sip show registry” to show you your trunk registrations
- Type “sip show peers” to show your extensions
- Type “sip show peer 100” to show you details of that extension (note: use the extension number you created if it’s not 100)
- Type “sip set debug on” to enable debugging and watch the SIP traffic
Using the above commands, and monitoring information on a busy phone system can be difficult due to the speed of the information that is coming in on your screen. The commands listed below would be best suited for busier environments as they remove a lot of noise that can occur while watching the SIP traffic.
- Type “exit” and hit enter to get back to the main command line prompt for your PBX
- Type “cd /var/log/asterisk” to view all of the logs
- Type “tail full” to view the full logs only
- Type “asterisk -r” to go back and write the command to remove debugging
- Type “sip set debug off” to turn off debugging, to avoid information overload when viewing your logs
- Type “exit” and hit enter to go back to the main command line prompt for your PBX
- Type “more full : grep 100” to give you all of the messages that include “100” (if different, replace 100 with the
- extension number that you created)
- Type “more full : grep -i unreachable” to view logs that indicate the extension was unreachable
These basic commands will give you an overview of what is going on with your extensions, trunks, or any potential trouble shooting that might be necessary if you run into any issues calling.
What is CLI?
CLI stands for Command Line Interface, which in this case is used to interact with your DIY PBX to automate, start, run, and end tasks, as well as pull up and reset information on your phone system.
How do I access the CLI?
Use the ‘asterisk -r’ command from your DigitalOcean droplet where you created your DIY PBX.