I've been trying to get this to work on a few occasion but I seem to be having a bit of trouble.
asterisk -rx "core show calls" | grep "active" | cut -d' ' -f1
The asterisk command runs from /usr/sbin/asterisk
Launching it like so, executes the asterisk executable and pipes the output, grep for active calls.
I usually get an Integer value which I would like to store in a variable and keep working the script from there.
I'm having a rough time passing arguments to the command.
I'm basically trying to make that command into a SHELL SCRIPT and store the value.
Can you guys, point me towards the right direction ?