[asterisk-users] Adding 4000 Lines to asteriskdb via asterisk -rx ?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Jan 8 17:29:16 MST 2007


On Mon, Jan 08, 2007 at 04:59:58PM +0100, Christoph Adomeit wrote:
> Hi there,
> 
> I want to add 4000 Callerids and Callernames to my asterisk-db.
> (/var/lib/asterisk/astdb)
> 
> I do not want an external database or an sql-database because I do 
> not want asterisk to depend on external processes.
> 
> However, when I do 4000 "database put number name" via a shellscript
> and "asterisk -rx" I only have 600 entries later in my asterisk-
> database. The asterisk sockets seems not to be designed for
> bulk updates to the asterisk-db. I also don't want to add 4000
> "sleep 1" to my shell-script.

If you have a 'sleep 1', you have a badly written script. You should
wait for Asterisk to finish.

However 4000 invocations of Asterisk can be a pain. Asterisk takes quite
a while to start.

I consider Asterisk's behaviour here a bug. Sadly others don't agree.

> 
> Does anybody have an Idea how to add these lines to asterisk ? I
> managed to Build a Perl DB_File Module for db1.8.5 but I do not
> have the know how how to use DB_file and db1 databases.

Option A: Use the manager interface.

Option B: write directly to the socket: ere: usint a small utility
called socat (there's that package in Debian)
http://threebit.net/mail-archive/asterisk-users/msg27519.html

The downside is that you can't tell of you had an error.

> 
> Are there some external utilities to lock and update the asteriskdb ?

Grab the sources of the berkely DB from the Asterisk source. It should
have a utility for manipulating a databae. Nothing about locking,
though, I guess.

-- 
               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