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

Gordon Henderson gordon+asterisk at drogon.net
Thu Jan 11 03:28:27 MST 2007


On Mon, 8 Jan 2007, Christoph Adomeit wrote:

> Are there some external utilities to lock and update the asteriskdb ?
> Is there a better way ?

A bit late on this and I see that there's a nice bit of perl posted to use 
the manager interface, but I've been doing something similar by writing a 
file which is then #included by extensions.conf, then zeroing the file 
after an asterisk -rx 'extensions reload' ('diaplan reload' for the 1.4 
people out there)

Eg. lines of:

DB(speedDialNum/10)=07712191046
DB(speedDialNam/10)=Gordon
DB(speedDialRNum/191046)=10

etc.

I'm not 100% sure the diaplan is meant to be abused in this way - it 
doesn't work on initial asterisk startup presumably because the DB 
engine/module isn't loaded... so because I have a small number of these 
for other purposes in the dialplan, I issue an extensions reload after 
starting asterisk for the very first time (in the /etc/init.d/asterisk 
script)

Maybe a bit of a "hit it on the head" approach, but it's quite simple. I 
just did a test with 10000 artificially generated values and it was about 
1.5 seconds on my 1GHz box. (vs. 0.2 seconds without the file, and 
generated a 1.4MB astdb - hardly a massive file!)

Cheers,

Gordon


More information about the asterisk-users mailing list