CLI Command Reference

The Asterisk Command Line Interface (CLI) has many commands which you can run to help diagnose and maintain your system. This chapter will be dedicated to explain the usage of those commands and when you might use them.

Which Commands Can I Use?

There are many commands which can be used to show you information about the current state of your system. The Asterisk CLI works very similar to many managed switches and routers CLI interfaces. You will find it fairly intuitive if you have used these CLI systems before, but we will assume you have not.

The first thing we need to know is what commands can we use? The Asterisk CLI allows the usage of tab completion which can be quite handy to reduce the amount of typing and help find a command. Pressing Tab twice will give a listing of available commands. If we press Tab twice at a new CLI prompt, we get the following listing of commands.


		*CLI> 
		!           abort       add         database    debug       dont        dump        extensions  help        iax2        include
		init        load        local       logger      meetme      no          pri         reload      remove      restart     save
		set         show        sip         soft        stop        unload      zap
		

Asterisk will show you all the commands available at that level. Since we haven't started typing any commands, Asterisk will show us the very first level. Lets start with the show command as it can be very useful to show us the state of our system. For a listing of the sub-commands we can use with show, we can type show at the CLI and press the Tab key twice. Doing this will give the following listing of commands.


		*CLI>  show
		agents       agi      application   applications  audio       channel     channels    codec         codecs    conferences   config
		dialplan     file     image         indications   keys        manager     modules     parkedcalls   queue     queues        switches
		translation  uptime   version       video         voicemail
		

As we can see, there are a wide range of things that show can tell us about our system. We won't go into details here, but we now have an idea of how we can find a listing of the commands we can use.