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

Christoph Adomeit Christoph.Adomeit at gatworks.de
Wed Jan 10 09:03:37 MST 2007


> Option A: Use the manager interface.
> 
Tzafrir , Thanks,

the idea to use the manager interface is wonderful. It is really fast
and no data gets lost. I don't think 4000 Rows are a noticeable 
amaount of data for a db1 database.

I coded this:
#!/usr/bin/perl

use Asterisk::Manager;

my $astman = new Asterisk::Manager;

$astman->user('admin');
$astman->secret('bla');
$astman->host('localhost');
$astman->connect || die "Could not connect to " . $astman->host . "!\n";

foreach $num(1..5000) {
  $astman->command("database put callerids willi$num $num");
}

$astman->disconnect;



-- 
Two hours of trial and error can save ten minutes of manual reading.
GATWORKS GmbH
Christoph.Adomeit at gatworks.de     Internetloesungen vom Feinsten
Fon. +49 2166 9149-32                      Fax. +49 2166 9149-10


More information about the asterisk-users mailing list