[asterisk-users] Reading/Writing the Astdb

C. Chad Wallace cwallace at lodgingcompany.com
Mon Jan 26 20:06:11 CST 2009


At 8:48 PM on 26 Jan 2009, cbbs70a at hotmail.com wrote:

> 
> Tzafrir;
>    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
> 
> both look like there was a connection to asterisk on the CLI, but no
> update. What am I missing? BTW; the difference between connecting to
> asterisk by doing a asterisk -rx "<cmd>" and doing it this way was >
> 500ms the first way and 7ms the second. Awesome.

Just guessing, but try it without the "asterisk -rx":

echo -n "database put FOO BAR 1" | socat -
UNIX-CONNECT:/var/run/asterisk/asterisk.ctl 

And if that doesn't work, maybe omit the "-n" so that it sends a
newline.


> > Date: Sat, 24 Jan 2009 23:23:40 +0200
> > From: tzafrir.cohen at xorcom.com
> > To: asterisk-users at lists.digium.com
> > Subject: Re: [asterisk-users] Reading/Writing the Astdb
> > 
> > On Sat, Jan 24, 2009 at 11:00:58AM -0500, cbbs70a at hotmail.com wrote:
> > > 
> > > All;
> > >    I have a question regarding the Astdb. When reading more than
> > > a few values, it can take quite a while to grab several
> > > values in the astdb using say, asterisk -rx "database show" >
> > > output.txt and work with that and then set a new value such as
> > > asterisk -rx "database put $key $value". The whole process can
> > > take over 1 second for EACH ENTRY which adds up for more than a
> > > few keys.
> > 
> > Either do that through the manager interface, or (if you want to
> > batch commands) send them directly over the unix-domain socket
> > asterisk.ctl .



-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.skihills.com/
OpenPGP Public Key ID: 0x262208A0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20090126/2f90195f/attachment.pgp 


More information about the asterisk-users mailing list