[Asterisk-Users] ast_sock_cmd: pipe commands to asterisk

Tzafrir Cohen tzafrir at cohens.org.il
Thu Dec 22 12:01:04 MST 2005


If you need to pipe commands to Asterisk without resorting to the
manager interface (e.g: requiring a specific user, hard-wiring password
or other authentication messure. After all: you're root of the machine
and know better than that lousy Asterisk process), you may want to use
the following.

It is a simple C program to pipe commands to asterisk.ctl . It was
written to help me and thus hardwires the path I use
(/var/run/asterisk/asterisk.ctl ) , but I'd welcome any fixes for that.

Usage:

build with:

  make ast_sock_cmd

example usage:

  echo -e "set verbose 3\nset debug 5" | ./ast_sock_cmd
  
  echo -e "restart now" | ./ast_sock_cmd

I'd also be happy to know of existing alternatives. It looked strange I
could not find such an existing tool to pipe text into a unix-domain
socket.

-- 
Tzafrir Cohen         | tzafrir at jbr.cohens.org.il | VIM is
http://tzafrir.org.il |                           | a Mutt's  
tzafrir at cohens.org.il |                           |  best
ICQ# 16849755         |                           | friend
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ast_sock_cmd.c
Type: text/x-csrc
Size: 3037 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20051222/d720ae40/ast_sock_cmd.c


More information about the asterisk-users mailing list