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 –[cc] asterisk -rx “core show channels” | grep “active call”
That works for Asterisk 1.8 and probably all other versions. It will just report how many active calls are in progress.
If we wanted it with the date and time we could run –[cc] 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 –[cc] echo ‘echo `date +”%d/%m/%y %H:%M”` – `/usr/sbin/asterisk -rx “core show channels” | grep “active call”`’ > /usr/local/bin/asterisk.calls
and check that it’s now in crontab with –[cc] crontab -l
That should write how many calls are in progress every 5 minutes to a file called /var/log/asterisk_calls.log.
Remember the log file will just keep growing over time if it’s not manually emptied.