On Mon, Jan 26, 2009 at 06:31:30PM -0800, Steve Edwards wrote:
> On Mon, 26 Jan 2009, [email protected] wrote:
>
> > That's a really good idea, however, I am having problems getting it to
> > work. I tried the following:
> >
> > echo -n "asterisk -rx \"database put FOO BAR 1\" " | socat -
> > /var/run/asterisk/asterisk.ctl
> >
> > and
> >
> > echo -n "asterisk -rx \"database put FOO BAR 1\" " | socat - UNIX-CONNECT:
> > /var/run/asterisk/asterisk.ctl
>
> echo -n "show channels"\
> | sudo socat STDIO UNIX-CONNECT:/var/run/asterisk.ctl
>
> and
>
> echo -n "show channels"\
> | sudo socat STDIO /var/run/asterisk.ctl
For a loop, though, you'll have to make sure each command is sent in its
own separate call to write() . The way I used was to put a 'sleep 0.001'
after each command.
Also note that you don't get the output of the command, nor is there any
error handling.
--
Tzafrir Cohen
icq#16849755 jabber:[email protected]
+972-50-7952406 mailto:[email protected]
http://www.xorcom.com iax:[email protected]/tzafrir
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users