Skip to main content

Off topic: Working with the Astdb

Posted by cbbs70a on Thu, 01/22/2009

All;
I am very sorry if this is off topic, working with the Astdb. I have found that for more than just a few keys to work with, it can take quite a while (on the order of many seconds) 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.
What I do now is dump the entire Astdb using "db_dump185" in about 0.003 ms, and then read the entire Astdb output as a hash and then manipulate key, value pairs that way. The entire process will take me less than 0.020 ms total.

My problem is this. I am unable to find a corresponding way of doing this in reverse. That is, I do not have a corresponding way to write the new values back to the Astdb. The most obvious way of writing to the Astdb is by using PERL's DB_File. I tried compiling DB_File using the Berkeley 1.85 lib and header to no avail. I've had no luck with db_load either.

Anyway, I know this is way off topic but the task has been on my to-do list for quite a while and I'd love to be able to cross it off. If anyone has done anything like this before I would be greatly indebted. Perhaps I need to throw up a bounty on this.

Best Regards;
FSD


Submitted by mattdarnell on Thu, 01/22/2009 Permalink

I would take this to the asterisk-users list.

http://lists.digium.com/mailman/listinfo/asterisk-users

There is also an asterisk-perl list:

****

Hi! This is the ezmlm program. I'm managing the

asterisk-perl@lists.gnuinter.net mailing list.

I'm working for my owner, who can be reached

at asterisk-perl-owner@lists.gnuinter.net.

This is a generic help message. The message I received wasn't sent to

any of my command addresses.

Here is a list of the command addresses supported:

Send mail to the following for info and FAQ for this list:

Similar addresses exist for the digest list:

To get messages 123 through 145 (a maximum of 100 per request), mail:

To get an index with subject and author for messages 123-456, mail:

To receive all messages with the same subject as message 12345,

send an empty message to:

The messages do not really need to be empty, but I will ignore

their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,

for example "john@host.domain", just add a hyphen and your

address (with '=' instead of '@') after the command word:

To stop subscription for this address, mail:

*****

-Matt