[asterisk-users] How to repeat pri show span and zap show channel
commands
Tzafrir Cohen
tzafrir.cohen at xorcom.com
Wed Feb 21 00:32:26 MST 2007
On Wed, Feb 21, 2007 at 07:56:18AM +0100, Olivier wrote:
> Hi,
>
> For debugging purpose, it might be useful to repeat every 30s or so, pri
> show span and zap show channel commands have the results merged with
> /var/log/asterisk/full log file?
Log to syslog (see the sample logger.conf), and run a cron script that
does that every minute.
Note: this is expected to generate a huge log file.
>
> Any better idea than running an dedicated shell script with a "asterisk -rx
> pri show span 1" line ?
Here is my pipeast script:
(while read line; do
echo -n "$line" # trim the ending newline
sleep 0.001 # generate different write(2)-s
done) | socat - /var/run/asterisk/asterisk.ctl
You can pipe whatever you want to that. e.g:
while true; do
echo pri show span 1
sleep 30
done | pipeast
Note: socat is available as a debian package:
http://packages.debian.org/socat .
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir at jabber.org
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
More information about the asterisk-users
mailing list