Asterisk active calls from the CLI mode

Here’s a quick way of keeping track of how many concurrent calls are in progress on your Asterisk system.
From the command line we can run -
asterisk -rx "core show channels" | grep "active call"
2 active calls

this command works on Asterisk 1.8 it just report how much active calls are 
if we wanted it with the date and time we could run-
echo `date +"%d/%m/%y %H:%M"` - `asterisk -rx "core show channels" | grep "active call"`

and if we wanted to run it every 5 minutes and write the output to a log we could add
it to cron like this-
echo 'echo `date +"%d/%m/%y %H:%M"` - `/usr/sbin/asterisk -rx "core show channels" | grep "active call"`' > /usr/local/bin/asterisk.calls
chmod 700 /usr/local/bin/asterisk.calls
crontab -l | (cat;echo '*/5 * * * * /usr/local/bin/asterisk.calls >> /var/log/asterisk_calls.log') | crontab